# Node.js Toolbox

Find actively maintained and popular libraries in the Node.js ecosystem.

# cheerio

Fast, flexible & lean implementation of core jQuery designed specifically for the server.

Parse HTML Content to File

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const http = require("http");
const cheerio = require("cheerio");
const fs = require("fs");
const url = "http://sports.sina.com.cn/nba/1.shtml";

function httpGet(url, cb) {
let html = "";
http.get(url, function (res) {
res.on("data", function (chunk) {
html += chunk;
});
res.on("end", function () {
cb(html);
});
}).on("error", function (e) {
console.log(e.message);
});
return html;
}

httpGet(url, function (html) {
const $ = cheerio.load(html);
$("#right a").each(function (index) {
const newUrl = $(this).attr("href");
httpGet(newUrl, function (body) {
const jq = cheerio.load(body);
fs.writeFile(
`./news/${index}.txt`,
jq("#artibody").text(),
function (err) {
if (err) {
console.log(err.message);
}
console.log("success");
}
);
});
});
});

# Chart.js

Simple yet flexible JavaScript charting for designers & developers

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>chartjs</title>
<script src="bower_components/chart.js/dist/Chart.js"></script>
</head>
<body>
<div
class="chart-container"
style="position: relative; height:40vh; width:80vw"
>
<canvas id="myChart"></canvas>
</div>
</body>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: "bar",
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [
{
label: "# of Votes",
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
"rgba(255, 99, 132, 0.2)",
"rgba(54, 162, 235, 0.2)",
"rgba(255, 206, 86, 0.2)",
"rgba(75, 192, 192, 0.2)",
"rgba(153, 102, 255, 0.2)",
"rgba(255, 159, 64, 0.2)",
],
borderColor: [
"rgba(255,99,132,1)",
"rgba(54, 162, 235, 1)",
"rgba(255, 206, 86, 1)",
"rgba(75, 192, 192, 1)",
"rgba(153, 102, 255, 1)",
"rgba(255, 159, 64, 1)",
],
borderWidth: 1,
},
],
},
options: {
scales: {
yAxes: [
{
ticks: {
beginAtZero: true,
},
},
],
},
},
});
</script>
</html>

# colors

get color and style in your node.js console.

# chalk

Terminal string styling done right.

# mockjs

生成随机数据,拦截 Ajax 请求

# pm2

Advanced, production process manager for Node.js

# lowdb

Small JSON database for Node, Electron and the browser. Powered by Lodash.

# chokidar

A neat wrapper around Node.js fs.watch / fs.watchFile / FSEvents.

# yrm

yrm can help you easy and fast switch between different npm registries, now include: npm , cnpm , taobao , nj(nodejitsu) , rednpm , yarn .

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Usage: yrm [options] [command]

Commands:

ls List all the registries
use <registry> Change registry to registry
add <registry> <url> [home] Add one custom registry
del <registry> Delete one custom registry
home <registry> [browser] Open the homepage of registry with optional browser
test [registry] Show the response time for one or all registries
help Print this help

Options:

-h, --help output usage information
-V, --version output the version number

# Prism

Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s used in millions of websites, including some of those you visit daily.

# furigana-markdown-it

furigana-markdown-it A markdown-it plugin which adds furigana support.

# case-police: 🚨

Make the case correct, PLEASE!

  • GitHub, not Github
  • TypeScript, not Typescript
  • macOS, not MacOS
  • VS Code, not Vscode

# Slidev

Presentation Slides for Developers.

# retypeapp/retype

Retype is an ✨ ultra-high-performance ✨ generator that builds a website based on simple text files. Focus on your writing while Retype builds the rest.

! A Retype Pro license would be required to unlock >100 pages.

# SBoudrias/Inquirer.js

A collection of common interactive command line user interfaces.

# haversnail/inquirer-date-prompt

A date prompt plugin for Inquirer.js.

# eduardoboucas/inquirer-table-prompt

A table-like prompt for Inquirer.

# NPKILL - Maintain your development workspace clean.

Npkill is a CLI tool that allows you to list all the heavy node_modules that you have scattered around your computer and allows you to delete those you don’t need in a very simple and elegant way.

You might be surprised how much space node_modules from old projects are silly taking up.

Edited on