In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use JSDev, a gadget to optimize the JavaScript development process. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
JSDev is an inconspicuous gadget recently developed by Douglas Crockford. His general idea is to preprocess JavaScript and selectively turn comments into corresponding code. Comment blocks processed by JSDev come in the following two forms:
/ * / () * /
Then you can specify which tag,JSDev is enabled by JSDev to change this comment to the corresponding code, which will not work when JavaScript is running normally, and will be removed after being compressed with tools such as JSMin, which facilitates the development of JavaScript.
At first, Lao Tao only gave the C language version of the program, a few days later he gave the JavaScript version, I think this is starting to become interesting, twisted for two days, want to see if it can be used in future development projects. Let's first take the C program as an example to illustrate the use of JSDev, and then talk about how to use it in node development or front-end development through the JavaScript version. This article assumes that you work in a Unix-like system (Linux/FreeBSD/Mac OS) and have some knowledge of command line and node programming.
C language version and the usage of JSDev
First clone my fork from github and compile the C source code into an executable file.
Source code on git clone https://github.com/yuest/jsdev.git # clone github to local cd jsdev gcc jsdev.c # compile C version sudo mv a.out / usr/local/bin/jsdev # move the compiled executable to a directory under $PATH
Now we can use jsdev to run the program. But enter jsdev on the command line and enter, but there is nothing. It turns out that the veteran only does the core part of the tool without any effort in the software interface, so there is not even a command usage prompt. As a preprocessor, it only eats the JavaScript code from the stdin and pulls the processed code out of the stdout. As for file manipulation, just use the pipeline feature of the unix command line.
To popularize, to input a file, such as in.js, into a jsdev program as stdin, use the less than symbol <, such as jsdev: jsdev out.js. If you want to try jsdev, just use jsdev
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.