![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@npmcli/template-oss
Advanced tools
This module bundles the npm CLI team's basics for package development into a single devDependency.
CAUTION: THESE CHANGES WILL OVERWRITE ANY LOCAL FILES AND SETTINGS
package.json
patchesThese fields will be set in the project's package.json
:
{
"author": "GitHub Inc.",
"files": ["bin", "lib"],
"license": "ISC",
"templateVersion": "1.0.0",
"scripts": {
"lint": "eslint '**/*.js'",
"lintfix": "npm run lint -- --fix",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"snap": "tap",
"test": "tap",
"posttest": "npm run lint",
}
}
The "templateVersion"
field will be set to the version of this package being
installed. This is used to determine if the postinstall script should take any
action.
The changes
constant located in lib/package.js
should contain all patches
for the package.json
file. Be sure to correctly expand any object/array based
values with the original package content.
Any existing .eslintrc.*
files will be removed, unless they also match the
pattern .eslintrc.local.*
These files will be copied, overwriting any existing files:
.eslintrc.js
.github/workflows/ci.yml
.gitignore
LICENSE.md
Place files in the lib/content/
directory, use only the file name and remove
any leading .
characters (i.e. .github/workflows/ci.yml
becomes ci.yml
and .gitignore
becomes gitignore
).
Modify the content
object at the top of lib/content/index.js
to include
your new file. The object keys are destination paths, and values are source.
These packages will be removed:
eslint-plugin-import
eslint-plugin-promise
eslint-plugin-standard
@npmcli/lint
Afterwards, these packages will be installed as devDependencies:
eslint
eslint-plugin-node
@npmcli/eslint-config
tap
Make changes to the removeDeps
and devDeps
arrays in lib/install.js
.
FAQs
templated files used in npm CLI team oss projects
The npm package @npmcli/template-oss receives a total of 3,193 weekly downloads. As such, @npmcli/template-oss popularity was classified as popular.
We found that @npmcli/template-oss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.