Last active
April 19, 2022 20:57
-
-
Save isaacs/cf8684d4c4c4ae720f08fca5d073c441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"hello-world-bespoke-archive-format","version":"1.0.0","main":"lib/index.js"} | |
console.log('hello, world!') | |
# hello-world-bespoke-archive-format | |
An example of a "hello world" program, but instead of being a tarball, it's | |
shown in the bespoke package format that npm *SHOULD* have used, instead of | |
tar. | |
One can be forgiven for not wanting to reinvent the wheel, but let this be a | |
lesson that, in fact, some wheels _ought_ to be reinvented, when the | |
alternative does not roll as easily. | |
{"package.json":[0,86],"lib/index.js":[86,29],"README.md":[115,379]}} | |
00000000000000000000000000000070 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AND AnOThER ThiNG!! If you nest these files within one another, then the parent can re-index the files of the children. So bundleDependencies could have something like:
So any
.npm
file that shows up in the archive has its entries automatically added to the index. Want to unpack the bundled deps? Easy peasy! They're right there! Want to just do 1 level? Or just 2 levels? Also easy!Jesus, I might have to sit down and write this some day just to get it out of my system.