nospm
A node/javascript package manager to replace npm.
To install run go install code.canop2p.com/admin/nospm@latest
Usage
Publish
To publish a package simply run nospm -dryrun publish
, it will output all the files collected and added to the archive.
For now you will need to create ~/.config/nospm/config.json
with {"nsec":"nsec1234"}
, eventually better key management would be needed.
If happy with the contents of the archive nospm publish
will upload to Blossom and also post an event of kind 33000 with the details of the module.
After successful completion it will provide a package ref in the form of npub/packagename
Import
To import, run nospm import npub/packagename
. This will search Nostr for the npub and event 33000, use the details to request the package from Blossom. Once downloaded it will extract all the contents into ./vendor/npub/packagename
. It will also update package.json
with the package details.
You will also need to update dependencies
with "modulename": "file:./vendor/npub/packagename"
Install
nospm install
will download all nospm dependencies and install in ./vendor
.
You would typically do this first, then npm i
second.