NAIO & Node.js All In One
NAIO & Node.js All In One
Node.js Tutorials
https://nodejs.org/en/docs/
https://nodejs.org/en/docs/guides/
https://nodejs.org/en/docs/guides/#general
https://nodejs.org/en/docs/guides/getting-started-guide/https://nodejs.org/en/docs/guides/#node-js-core-concepts
https://nodejs.org/en/docs/guides/blocking-vs-non-blocking/https://nodejs.org/en/docs/guides/#module-related-guides
https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/
node.js tutorials
https://www.w3schools.com/nodejs/
https://www.javatpoint.com/nodejs-tutorial
https://www.tutorialspoint.com/nodejs/
https://stackify.com/learn-nodejs-tutorials/
https://www.codecademy.com/learn/learn-node-js
node.js 教程
https://www.runoob.com/nodejs/nodejs-tutorial.html
https://www.liaoxuefeng.com/wiki/1022910821149312/1023025235359040
https://www.cnblogs.com/chyingp/p/nodejs-learning-guide-github-got-1000-stars.html
https://github.com/chyingp/nodejs-learning-guide
https://nqdeng.github.io/7-days-nodejs/
https://nodejs.jakeyu.top/
https://www.zhihu.com/question/19793473
videos
https://www.imooc.com/course/list?c=nodejs
https://edu.aliyun.com/course/469/lesson/list
node.js & write file & read file
write & read
https://stackoverflow.com/a/15554600/5934465
https://stackoverflow.com/a/2497040/5934465

// preview.js
const fs = require("fs");
const readline = require("readline");
fs.writeFile("file.js", `export const APP_ENV = "preview";`, function(err) {
if(err) {
console.log(err);
return err;
}
let env = "preview";
console.log("The file was saved!", env);
});
let rd = readline.createInterface({
input: fs.createReadStream("file.js"),
output: process.stdout,
console: false
});
rd.on("line", function(line) {
console.log(`line =`, line);
});
// fs.writeFile("file.txt", "prview", function(err) {
// if(err) {
// console.log(err);
// return err;
// }
// console.log("The file was saved!");
// });
// global.APP_ENV = "testing";
// let APP_ENV = global.APP_ENV;
// console.log(`APP_ENV =`, APP_ENV);
// let rd = readline.createInterface({
// input: fs.createReadStream('file.txt'),
// output: process.stdout,
// console: false
// });
// rd.on('line', function(line) {
// console.log(`line =`, line);
// });
// testing.js
const fs = require("fs");
const readline = require("readline");
fs.writeFile("file.js", `export const APP_ENV = "testing";`, function(err) {
if(err) {
console.log(err);
return err;
}
let env = "testing";
console.log("The file was saved!", env);
});
// const rl = readline.createInterface({
// input: process.stdin,
// output: process.stdout
// });
// absolute path
// fs.open("/open/some/file.txt", "r", (err, fd) => {
// if (err) {
// throw err;
// }
// fs.close(fd, (err) => {
// if (err) {
// throw err;
// }
// });
// });
// global.APP_ENV = "testing";
// let APP_ENV = global.APP_ENV;
// console.log(`APP_ENV =`, APP_ENV);
// relative path
// fs.open("file.js", "r", (err, fd) => {
// if (err) {
// throw err;
// }
// console.log(`fd =`, fd);// 3
// fs.close(fd, (err) => {
// if (err) {
// throw err;
// }
// });
// });
let rd = readline.createInterface({
input: fs.createReadStream("file.js"),
output: process.stdout,
console: false
});
rd.on("line", function(line) {
console.log(`line =`, line);
});
// file.js
export const APP_ENV = "testing";
bash shell
mkdir -p
# mkdir -p /xyz/abc 父级文件夹不存在也可创建
$ mkdir -p /xyz/abc

cli & env runtime
https://www.jikexueyuan.com/course/1332_2.html


cmd
#!/usr/bin/env node
echo "^v^ app is running in production building!" && npm run build
bash
#!/usr/bin/env bash
echo "^v^ app is running in production building!" && npm run build
process.argv

tj & commander.js
https://github.com/tj?tab=repositories
https://github.com/tj/commander.js
https://github.com/xgqfrms/vscode/issues/20
https://github.com/tj/commander.js/blob/master/Readme_zh-CN.md
minimist
https://github.com/substack/minimist

--val

-v & --version

options & help
usage.txt


color


v 1.0.0

colors
https://github.com/xgqfrms-GitHub/Node-CLI-Tools
CLI & CLP


npm link

nvm
强烈建议使用nvm(Node Version Manager) ,nvm是 Nodejs 版本管理器,它让我们方便的对切换Nodejs 版本。
nvm 介绍:使用 nvm 管理不同版本的 node 与 npm



NAIO & Node.js All In One的更多相关文章
- node.js学习(三)简单的node程序&&模块简单使用&&commonJS规范&&深入理解模块原理
一.一个简单的node程序 1.新建一个txt文件 2.修改后缀 修改之后会弹出这个,点击"是" 3.运行test.js 源文件 使用node.js运行之后的. 如果该路径下没有该 ...
- 利用Node.js的Net模块实现一个命令行多人聊天室
1.net模块基本API 要使用Node.js的net模块实现一个命令行聊天室,就必须先了解NET模块的API使用.NET模块API分为两大类:Server和Socket类.工厂方法. Server类 ...
- Node.js:进程、子进程与cluster多核处理模块
1.process对象 process对象就是处理与进程相关信息的全局对象,不需要require引用,且是EventEmitter的实例. 获取进程信息 process对象提供了很多的API来获取当前 ...
- Node.js:理解stream
Stream在node.js中是一个抽象的接口,基于EventEmitter,也是一种Buffer的高级封装,用来处理流数据.流模块便是提供各种API让我们可以很简单的使用Stream. 流分为四种类 ...
- Node.js:Buffer浅谈
Javascript在客户端对于unicode编码的数据操作支持非常友好,但是对二进制数据的处理就不尽人意.Node.js为了能够处理二进制数据或非unicode编码的数据,便设计了Buffer类,该 ...
- node.js学习(二)--Node.js控制台(REPL)&&Node.js的基础和语法
1.1.2 Node.js控制台(REPL) Node.js也有自己的虚拟的运行环境:REPL. 我们可以使用它来执行任何的Node.js或者javascript代码.还可以引入模块和使用文件系统. ...
- Node.js npm 详解
一.npm简介 安装npm请阅读我之前的文章Hello Node中npm安装那一部分,不过只介绍了linux平台,如果是其它平台,有前辈写了更加详细的介绍. npm的全称:Node Package M ...
- Node.js入门(一)
一.Node.js本质上是js的运行环境. 二.可以解析js代码(没有浏览器安全级的限制): 提供系统级的API:1.文件的读写 2.进程的管理 3.网络通信 三.可以关注的四个网站: 1.https ...
- Node.js学习笔记——Node.js开发Web后台服务
一.简介 Node.js 是一个基于Google Chrome V8 引擎的 JavaScript 运行环境.Node.js 使用了一个事件驱动.非阻塞式 I/O 的模型,使其轻量又高效.Node.j ...
随机推荐
- JAVA中关于基本数据和引用数据参数传递过程
基本数据和引用数据参数传递过程 案例1:判断程序的输出结果 class Demo{ public static void main(String[] atgs){ int x =4; show(x); ...
- DP 状态 DP 转移方程 动态规划解题思路
如何学好动态规划(2) 原创 Gene_Liu LeetCode力扣 今天 算法萌新如何学好动态规划(1) https://mp.weixin.qq.com/s/rhyUb7d8IL8UW1IosoE ...
- 内网渗透之信息收集-windows
用户相关 query user #查看当前在线的用户 whoami #查看当前用户 net user #查看当前系统全部用户 net1 user #查看当前系统全部用户(高权限命令) net user ...
- 截止9月20日,xx行动中已知漏洞
VMware Fusion cve-2020-3980权限提升 Apache Cocoon security vulnerability cve-2020-11991 Spring框架RFD(文件下载 ...
- oracle根据日期计算星期几
工作中用到的,在存储过程中的语句,简单记下: /** 判断输入日期是星期几 */ select decode(to_char(to_date(iv_date,'yyyy-mm-dd'), 'day') ...
- python--可迭代对象、迭代器和生成器
迭代器 1.什么是迭代器? 不依赖于索引的取值方式 迭代是一个重复的过程,即每一次重复为一次迭代,并且每次迭代的结果都是下一次迭代的初始值 示例: str1 = 'abcde' count = 0 w ...
- Flink-v1.12官方网站翻译-P016-Flink DataStream API Programming Guide
Flink DataStream API编程指南 Flink中的DataStream程序是对数据流实现转换的常规程序(如过滤.更新状态.定义窗口.聚合).数据流最初是由各种来源(如消息队列.套接字流. ...
- 和我一起理解js中的事件对象
我们知道在JS中常用的事件有: 页面事件:load: 焦点事件:focus,blur: 鼠标事件:click,mouseout,mouseover,mousemove等: 键盘事件:keydown,k ...
- Kwp2000协议的应用(硬件原理使用篇)
作者:良知犹存 转载授权以及围观:欢迎添加微信:becom_me 发现K线没有过多的文章描述,作为一个开发过K线的人,不写些文章帮助后来的人岂不是太浪费开发经验了呢. 总述 KWP2000是一 ...
- Codeforces Round #664 (Div. 2) D. Boboniu Chats with Du
传送门:cf1395D 题意 给定一个长度为n的数组a[i]为当天说话的有趣值,如果a[i]>m,那么在 i 之后有d天不能说话.否则可以每天都说话.找到一个排列使得n天有趣值总和最大,问有趣值 ...