2020nodesnippets 中文文档教程
2020 Node Snippets
这些是 Node.js 的一些有用的小功能
Features
- Easier printing to console
- Array sorting
- Array random shuffling
- Remove item from array by value
- Remove item from array by index
- Factorial
- Permutaion
- Combination
Installation
要安装 2020 Node Snippets,您需要 Node.js (https://nodejs.org),并且需要使用 npm init
。 运行命令 npm install 2020nodesnippets
将包安装到目录中。
Usage Example
const ns = require('2020nodesnippets');
let x = [1, 2, 3, 4, 5];
let y = ns.randshuffle(x);
ns.print(y);
Github Repository and npm package
Github 存储库可在 https://github.com/NavSous/Node_Snippets 访问 npm 包可在 https://www.npmjs.com/package/2020nodesnippets 访问
2020 Node Snippets
These are some small helpful function for Node.js
Features
- Easier printing to console
- Array sorting
- Array random shuffling
- Remove item from array by value
- Remove item from array by index
- Factorial
- Permutaion
- Combination
Installation
To install 2020 Node Snippets, you will need Node.js (https://nodejs.org) and you will need to initialize npm in a directory using npm init
. Run the command npm install 2020nodesnippets
to install the package in the directory.
Usage Example
const ns = require('2020nodesnippets');
let x = [1, 2, 3, 4, 5];
let y = ns.randshuffle(x);
ns.print(y);
Github Repository and npm package
The Github repository is accessible at https://github.com/NavSous/Node_Snippets The npm package is accessible at https://www.npmjs.com/package/2020nodesnippets