一键导入
npm-packages
Conventions for package.json, README.md, coding & testing styles
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Conventions for package.json, README.md, coding & testing styles
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | npm-packages |
| description | Conventions for package.json, README.md, coding & testing styles |
Include these keys:
{ ".": { "default": "./dist/package-name.min.js", "types": "./package-name.d.ts" } }{
"build": "npx -y esbuild package-name.js --bundle --format esm --minify --outfile=dist/package-name.min.js",
"lint": "dprint fmt -c https://raw.githubusercontent.com/sanand0/scripts/refs/heads/main/dprint.jsonc && npx -y oxlint --fix",
"test": "npx -y vitest@3 run --globals",
"prepublishOnly": "npm run lint && npm run build && npm test"
// docs, watch, pretest, ...
}
npx -y in scripts over devDependencies. Used mainly if tests/utilities need packages, e.g. jsdom, playwright, sharpInclude these H2 headings in order:
Begin with shields, followed by a 1-line description of the package. Shields include
[](https://www.npmjs.com/package/package-name)
[](https://opensource.org/licenses/MIT)
[](https://bundlephobia.com/package/package-name)
Installation. Typically:
Add this to your script:
```js
import { something } from "package-name";
```
To use via CDN, add this to your HTML file:
```html
<script type="importmap">
{
"imports": {
"package-name": "https://cdn.jsdelivr.net/npm/package-name@1"
}
}
</script>
```
To use locally, install via `npm`:
```bash
npm install package-name
```
... and add this to your HTML file:
```html
<script type="importmap">
{
"imports": {
"package-name": "./node_modules/package-name/dist/package-name.js"
}
}
</script>
```
Usage. Provide detailed examples covering all scenarios
Development. Use this content:
git clone https://github.com/user/package-name.git
cd package-name
npm install
npm run lint && npm run build && npm test
npm publish
git commit . -m"$COMMIT_MSG"; git tag $VERSION; git push --follow-tags
Release notes. This is a list of [x.y.z](https://npmjs.com/package/package-name/v/x.y.y): dd mmm yyyy: Description of the change
License. Just mention [MIT](LICENSE)
Follow these conventions:
.d.ts for public APIs where feasible*.test.js (or *.spec.ts for Playwright suites)describe, it), deterministic tests, small fixtures; mock network when applicablenode_modules/
dist/
ALWAYS follow this style when writing Python / JavaScript code
To select, design, annotate, and verify a data visualization (chart, map, or table).
ALWAYS follow this design guide for any front-end work
Use this for non-trivial analysis, design, diagnosis, review, strategy, or judgment. Skip it for simple lookups, mechanical rewrites, and pure tone tasks.
For CloudFlare development, deployment, e.g. Python CloudFlare Workers
Use when creating demos or POCs