Skip to content

Example Bundling of Package with NPM

Terminal window
npm install verdaccio
verdaccio
Terminal window
head -c 100M </dev/urandom > myfile
mkdir -p myPackage/files/
tar -czf ./myPackage/files/myPackage-1.0.0.tgz myfile
{
"name": "myPackage",
"version": "1.0.0",
"description": "A generic package tarball",
"main": "index.js",
"files": [
"files/myPackage-1.0.0.tgz"
]
}
Terminal window
npm pack myPackage
npm publish myPackage --registry http://localhost:4873
Terminal window
npm install myPackage --registry http://localhost:4873
ls -grtha ./*myPackage*