§2024-06-08

new naming conventions:

  • File and Directory Names in Linux: - Use snake case: my_project, data_backup_2024, config_files
  • Code Conventions in Node.js: - Use camel case for variables and functions: myVariableName, fetchUserData - Use Pascal case for class names: MyClass, UserModel

use fnm node version control

¶ 1. Create project directory as quickstart

機器: hc4Nas02.yushei.net

alexlai@hc4nas02:~$ pwd
/home/alexlai
alexlai@hc4nas02:~$ mkdir docsify_proj && cd $_
alexlai@hc4nas02:~/docsify_proj$ mkdir quickstart && cd $_
alexlai@hc4nas02:~/docsify_proj/quickstart$ which npm node
/run/user/1026/fnm_multishells/865354_1717806322043/bin/npm
/run/user/1026/fnm_multishells/865354_1717806322043/bin/node
alexlai@hc4nas02:~/docsify_proj/quickstart$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (quickstart) 
version: (1.0.0) 
description: docsify quickstart guide
entry point: (index.js) 
test command: 
git repository: 
keywords: 
author: alexlai@h2Jammy.yushei.net
license: (ISC) 
About to write to /home/alexlai/docsify_proj/quickstart/package.json:

{
  "name": "quickstart",
  "version": "1.0.0",
  "description": "docsify quickstart guide",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "alexlai@h2Jammy.yushei.net",
  "license": "ISC"
}


Is this OK? (yes) 

npm notice
npm notice New minor version of npm available! 10.7.0 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice To update run: npm install -g npm@10.8.1
npm notice
alexlai@hc4nas02:~/docsify_proj/quickstart$ npm install -g npm@10.8.1

removed 2 packages, and changed 63 packages in 12s

24 packages are looking for funding
  run `npm fund` for details
alexlai@hc4nas02:~/docsify_proj/quickstart$ ls -l
total 4
-rw-rw-r-- 1 alexlai alexlai 256 Jun  8 08:41 package.json
alexlai@hc4nas02:~/docsify_proj/quickstart$ cat package.json 
{
  "name": "quickstart",
  "version": "1.0.0",
  "description": "docsify quickstart guide",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "alexlai@h2Jammy.yushei.net",
  "license": "ISC"
}

¶ 2. install