Test-npm-publish
Overview
A repo to test publishing an npm package.
How this repository was created
The following steps were run:
mkdir test-npm-publish
cd test-npm-publish
-
npm init --scope=@wingy3181 -y
(and optionally change any values inpackage.json
like the version number. license and npm scripts) -
echo "console.log('test-npm-publish');" > index.js && touch README.md
(and these instructions were written insideREADME.md
) git init && g cup
- Empty remote repository was created on GitHub via browser UI
- Following git commands were run to push local code to GitHub
git remote add origin git@github.com:wingy3181/test-npm-publish.git git branch -M main git push -u origin main
How this repository was published to npm registry
The following steps were run:
-
npm adduser
and entered npm registry details to login npm publish --access=public
How to consume this package published to the npm registry
Run npm install @wingy3181/test-npm-publish
within a npm project
How to unpublish package from registry
To unpublish a single version of a package, run npm unpublish @wingy3181/test-npm-publish@0.0.1
NOTE:
- If you do not specify a version or if you remove all of a package's versions then the registry will remove the root package entry entirely.
- Even if you unpublish a package version, that specific name and version combination can never be reused. In order to publish the package again, you must use a new version number.
To unpublish the entire package, run npm unpublish @wingy3181/test-npm-publish --force
NOTE:
- If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.