![]() If you have any question regarding this or anything I should add, correct or remove, feel free to comment, email or DM me. With the knowledge, create your real-world example and make it a CLI with the tweaks you learned here. I know I didn’t demonstrate with a real-world example, I only explained and demoed how to configure to get your CLI. It is very easy, just a couple of tweaks you have your CLI. See we demonstrated how to create a command-line tool in JS using Nodejs. You can also publish the new updates to NPM to add the new commands.Īfter done with that, our users can use our commands as shell commands: $ hello Hello world $ sayName I'm Chidume Nnamdi I am a Software Developer $ tip Never give up There is light at the end of the tunnel $ today Today's date is Fri Conclusion Run the npm link to create symlinks for our new commands. Now our node-cli project folder would look like this: node-cli index.js sayName.js tip.js today.js package.json. #!/usr/bin/env node // sayName.js console.log("Im Chidume Nnamdi\n") console.log("I am a Software Developer") #!/usr/bin/env node // tip.js console.log("Never give up") console.log("There is light at the end of the tunnel") #!/usr/bin/env node // today.js console.log("Today's date is " Date.now().toLocaleString()) ![]() Prior to the mainstream adoption of Wake on LAN, the commands were previously sent via the command line, and some programs still use this method of execution to run their applications. Now, let’s create the files: touch sayName.js touch tip.js touch today.js Depicus WOL GUI is another Wake on LAN tool that uses a Graphical User Interface to send commands to the computers on your network. The bin property is now an object that holds the command and its corresponding file to call. We can create our our program and run it in cmd-line: // hello.cpp #include int main() The ls file is forked and run, the results it returns is displayed on the cmd/bash/sh. If we run the ls command to list files and folders in our current directory: $ ls 'autorun.inf/' 'System Information/' app, in Linux systems there is no file extension) in our system path, written in C/C and compiled to executable format. We know the popular commands we use in cmd/bash: Without Nodejs, we will just write a cmd0line in C/C and compile to executable. You see, Nodejs made us be able to write command-line tools in our fav language: JS. Bit: Easily reuse and sync small modules and utils across JS projects Short intro
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |