包中。Json
package name: (03test-array-map)
version: (1.0.0)
description: array map function use ts
entry point: (index.js) ./dist/test-array-map.js
{
"name": "03test-array-map",
"version": "1.0.0",
"description": "array map function use ts",
// 下載這個包的使用者會到 "./dist/test-array-map.js" 這個路徑下引入文件
"main": "./dist/test-array-map.js"
}
tsconfig。Json
終端機輸入
tsc --init
。Npmignore
npm發包的忽略檔案配置,預設node_modules是被忽略的
// 忽略 example 資料夾下的所有檔案
/example/
終端機輸入指令
npm login
輸入在 npm 註冊的帳號
【中文翻译
npm犯错!在大多数情况下,您或您的一个依赖项正在发出请求
npm犯错!安全策略禁止的包版本。
(1)、(2)、(3
npm publish
// 出現下面訊息就代表成功
npm notice
+ [email protected]