2020nodesnippets

A group of helpful snippets for Node.js

Usage no npm install needed!

<script type="module">
  import 020nodesnippets from 'https://cdn.skypack.dev/2020nodesnippets';
</script>

README

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