c-0 9429

Node.js

57 1
2026-05-31
B

What is Node.js?

At its most basic level, Node.js is an open-source, cross-platform runtime environment that allows you to run JavaScript code outside of a web browser.

Traditionally, JavaScript was only used inside web browsers to make websites interactive (the frontend). Node.js changed everything by taking the ultra-fast V8 JavaScript engine—originally built by Google for the Chrome browser—and allowing it to run natively on servers or local computer operating systems (the backend).

Why Do Developers Use It?

  • A Single Language: Developers can use JavaScript to write both their website's user interface and the underlying server logic, meaning they don't have to switch between different programming languages.
  • High Performance: Because it is powered by Google's V8 engine, Node.js executes code incredibly fast by compiling JavaScript directly into native machine code.
  • Asynchronous Processing: It is designed to handle multiple tasks at once. It can process thousands of file reads or database requests simultaneously without getting "stuck" waiting for a single task to finish.
  • Massive Library Ecosystem: It includes npm (Node Package Manager), which is the largest registry of open-source software libraries in the world. This allows developers to easily download pre-written tools instead of building everything from scratch.

how to setup node.js step by step

Step 1: Download the Node.js Installer

  1. Open your web browser and go to the official website: https://nodejs.org/
  2. Download the LTS (Long Term Support) version. This is the most stable release recommended for most users.
  3. Once the installer file (.msi for Windows or .pkg for macOS) finishes downloading, open it.

Step 2: Run the Installation Wizard

  1. Click Next to accept the license agreement.
  2. Keep all the default settings selected (do not uncheck any boxes).
  3. Important for Windows users: If a screen asks to install "Tools for Native Modules," leave it unchecked (you do not need extra C++ compilation tools for this project).
  4. Click Install, authorize administrative access if prompted, and click Finish.

Step 3: Verify the Installation

  1. Open your terminal:
    • Windows: Press the Win Key + R, type cmd, and hit Enter to open the Command Prompt.
    • Mac: Press Cmd + Space, type Terminal, and hit Enter.
  2. Run the following command to check the Node version:
    node -v
    (You should see a version number output like v20.x.x or higher).
  3. Run the following command to check npm (Node Package Manager, installed automatically alongside Node):
    npm -v

Step 4: Initialize Your Converter Project Folder

  1. Create a dedicated folder on your computer for your conversion project (e.g., stroke-converter).
  2. Navigate into that folder using your terminal:
    cd path/to/your/stroke-converter
  3. Initialize a Node.js project inside the folder by running:
    npm init -y
    (This instantly generates a package.json file that keeps track of your installed tools).

Step 5: Install Required Conversion Libraries

Run this single command in your terminal while inside your project folder to install the parsing tools:

npm install cheerio svg-path-properties

Once installed, your environment is fully configured. You can now create a .js file inside that folder to run your SVG conversion scripts.

convert.js

1. convert.js

Create a file named convert.js in your project folder

2. How to Run the Script

  1. Place your animCJK SVG files into a folder named svgsZhHant inside your project directory.
  2. Open your terminal in the project directory and run:
    node convert.js

To convert Hong Kong files later, change INPUT_DIR = './svgsZhHk' and SUFFIX = 'hk' at the top of convert.js and run the script again.


c-1 9429

已複製到剪貼簿
網址 QR Code (Node.js)
本頁網址 QR Code
Menu2

E-Mail:[email protected]

www.hkcards.com

2010 - 2026

hkcards 倉頡字典
學倉頡
學倉頡16688
倉頡字母及輔助字形7136
倉頡對字的切割2854
倉頡字母「日月金木水火土」5531
倉頡練習:日月金木水火土 練習11071
倉頡字母「竹戈十大中一弓」4575
倉頡練習:竹戈十大中一弓 練習10518
倉頡字母「人心手口」2758
倉頡練習:人心手口 練習4921
倉頡字母「尸廿山女田卜」3550
倉頡練習:尸廿山女田卜 練習5133
倉頡「難」鍵1962
輸入倉頡字母所代表的字1739
倉頡字母及輔助字形練習 練習15864
鍵盤打字教學3752
倉頡盲打練習 練習27682
倉頡取碼的基本原則4140
倉頡初階練習 練習9633
連體字2184
連體字練習 練習3992
倉頡輔助字形的倉頡碼1162
分體字1775
字首1066
字身1233
分體字練習 練習3093
特別字首1203
特別字首練習 練習1567
容易錯的字首979
容易錯的字首練習 練習1932
倉頡字形 vs 香港小學字形1133
倉頡裏一些容易混淆的字形2094
複合字1391
複合字練習 練習2241
包含省略原則1516
包含省略原則練習 (1) 練習843
包含省略原則練習 (2) 練習918
難字1180
難字練習 練習1867
特殊字1939
特殊字練習 練習1494
結語744
下載倉頡字母及輔助字形表9657
三大主流作業系統的倉頡輸入法863
在 Win11 安裝「微軟倉頡」4840
在 Win11 使用「微軟倉頡」輸入中文1295
Android 的「Gboard 鍵盤」倉頡1529
iPhone, iPad & Mac 啟用原生的倉頡輸入法的方法1854
倉頡輸入法練習 練習10912
倉頡難拆字練習 練習2630