当前位置:网站首页>Note: common gadgets in project architecture
Note: common gadgets in project architecture
2022-06-13 01:24:00 【Durian is not delicious】
cheerio
stay node End , Like use jquery Do that dom
var fileitem = fs.readFileSync(newformDirPath);
var $ = cheerio.load(fileitem.toString());
$.html() // Of the entire page html
$('.app').html(); // app Inside html
nodemon
nodemon It's a tool , You can automatically detect changes in files in the directory and debug by restarting the application node.js Applications for , Every time when developing ,nodemon The document will be updated in time , Very convenient ,
package.json
nodemon ./src/js/index.js
The configuration file :nodemon.json
{
"restartable": "nv",
"delay": 1000,
"colours": false,
"verbose": true,
"ignore": [
"./node_modules","./dist"
],
"watch": [
"src/*.js","src/*.html"
],
"events": {
"restart": ""
},
"execMap": {
"js": "npm run build"
},
"ext": "js, json",
"env": {
"NODE_ENV": "development",
"PORT": "3000"
}
}
rimraf
rimraf The role of : Pack... In bags rm -rf command , Used to delete files and folders , Whether the folder is empty or not , Can be deleted
rimraf ./dist
browserify
You can use something like node Of require() The way to organize the browser side Javascript Code
// package.json take ./src/js/index.js Inside require The code that can be parsed into the browser is placed in lib/index.js Inside
"browserify": "browserify ./src/js/index.js -o lib/index.js",
babel
Can be es6 The grammar translates into es5 grammar
Usage can be found on the official website . Usually, there are many in the project architecture .
chalk-pipe
Create a chalk style scheme using simpler style strings
chalk
Handle terminal string style correctly
Commander.js
complete node.js Command line solutions
Inquirer.js
A common set of interactive command line user interfaces .
slash
System path character processing
minimist
Parse parameter options
dotenv
Change the environment variable from .env File loading to process.env in
dotenv-expand
Expand the environment variables that already exist on the computer
hash-sum
Very fast unique hash generator
deepmerge
Deep merge enumerable properties of two or more objects .
yaml-front-matter
analysis yaml or json
resolve
Realization node Of require.resolve() Algorithm , So you can use it asynchronously and synchronously require.resolve() For documents
semver
npm Semantic versioner for
leven
Measure the difference between two strings
One of the fastest JS Implementation one
lru-cache
Delete the cache object of the least recently used item
portfinder Automatic search 8000 to 65535 Available port number in
ora
Elegant terminal wheel
Gulp
gulp It's a flow based automated build tool , In addition to managing and executing tasks , It also supports listening to read and write files .
Grunt
Grunt It's a JavaScript Task runner , Use... Itself JavaScript Development , Flexible management of inter task dependencies and Perform defined tasks
envinfo
Generate troubleshooting software problems ( Such as operating system 、 Binary version 、 browser 、 Installed language, etc ) General details required when reporting
memfs
Memory file system and Node’s fs API The same implementation
execa
Process execution for humans
webpack-merge
Used to join arrays and merge objects , To create a new object
webpack-chain
Use chain API To generate simplification webpack Version configuration changes
strip-ansi
Remove from a string ANSI Escape code
address
Get the... Of the current machine IP, MAC and DNS The server .
default-gateway
Through to OS Routing interface exec Call to get the default gateway of the machine
joi
JavaScript The most powerful schema description language and data validator .
fs-extra
Added not included in native fs File system method in module , And to fs Method added promise Support
Acorn
A small, fast JavaScript Parser , Use it completely JavaScript To write .
zlib.js
ZLIB.js yes ZLIB(RFC1950), DEFLATE(RFC1951), GZIP(RFC1952) and PKZIP stay JavaScript Realization .
fis3
FIS3 Front end oriented engineering construction system . Solve performance optimization in front-end engineering 、 Resource loading ( asynchronous 、 Sync 、 On demand 、 Preloading 、 Dependency management 、 Merge 、 Embedded )、 Modular development 、 Automation tools 、 The development of specification 、 Code deployment and so on .
rollup
Focus on ES6 modularization , A small piece of code can be compiled into larger or more complex content , For example, libraries or applications .
webpack
Webpack It's a module packer . Its main purpose is to bind JavaScript File to use in the browser , But it can also convert 、 Bundle or package almost any resource or asset
parcel
Parcel Is a zero configuration network building tool . It combines a great development experience out of the box with an extensible architecture , You can transform your project from just getting started to a mass production application .
vite
One through native ES Module is the development server that serves your source files , It has rich built-in functions and surprisingly fast hot module replacement (HMR).
A build command , Compare your code with Rollup Tied together , Pre configured to output highly optimized static assets for production .
yuicompressor
YUI Compressor It's a JavaScript compressor , In addition to deleting comments and spaces , It also uses the smallest possible variable name to confuse local variables . This confusion is safe , Even if you use something like ‘eval’ or ‘with’ And so on ( Although compression is not optimal in these cases ) And jsmin comparison , The average savings are about 20%.
YUI Compressor It can also safely compress CSS file . According to the file extension (js or css) Decide which compressor to use
边栏推荐
- Tkinter library installation
- Summary of various installation methods of Lab View
- Stack stack LIFO
- Argparse command line passes list type parameter
- Go JWT learning summary
- Continue when the condition is not asked, execute the parameter you compare
- Several categories of software testing are clear at a glance
- 生态聚合NFT来袭,Metaverse Ape引领Web 3.0元宇宙新范式革命
- Page optimization - Notes
- leetcode 206. Reverse linked list
猜你喜欢

Leetcode question brushing 04 string

【斯坦福计网CS144项目】Lab1: StreamReassembler
![[Stanford Jiwang cs144 project] lab1: streamreassembler](/img/7b/fad18b68a6ee30d1dec4dad6273b98.png)
[Stanford Jiwang cs144 project] lab1: streamreassembler

5G工业网关在煤矿行业的应用优势

Matrix fast power

论文笔记:STMARL: A Spatio-Temporal Multi-AgentReinforcement Learning Approach for Cooperative Traffic

Leetcode question brushing 06 bit operation

Leetcode question brushing 03 stack

A problem discovery and attempted solution to the strange stop of server script

Summary of various installation methods of Lab View
随机推荐
Common skills for quantitative investment - drawing 3: drawing the golden section line
Minimum spanning tree problem
Five classic articles worth reading
Stmarl: a spatio temporal multi agentreinforcement learning approach for cooperative traffic
Method of cleaning C disk
The tle4253gs is a monolithic integrated low dropout tracking regulator in a small pg-dso-8 package.
Page optimization - Notes
Polymorphism and virtual function
MySQL performance optimization
My crawler learning notes
Higherhrnet pre training model -- download from network disk
軟件測試的幾種分類,一看就明了
QT color extraction
[leetcode] valid phone number Bash
数学知识整理:极值&最值,驻点,拉格朗日乘子
The second round of mesa
Leetcode question brushing 03 stack
Memory learning book reference
ES6 deconstruction assignment
Exercise 5.14 input n strings, arrange them in alphabetical order and output them.