https://github.com/legend80s/npm-publish-parser
Parse the output of `npm publish --dry-run` into JSON.
https://github.com/legend80s/npm-publish-parser
Last synced: 21 days ago
JSON representation
Parse the output of `npm publish --dry-run` into JSON.
- Host: GitHub
- URL: https://github.com/legend80s/npm-publish-parser
- Owner: legend80s
- License: mit
- Created: 2024-08-19T01:22:26.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-08-25T12:30:15.000Z (9 months ago)
- Last Synced: 2025-03-19T09:02:39.451Z (2 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-publish-parser
> Parse the output of `npm publish --dry-run` into JSON.
## Example
```js
import { toJSON } from 'npm-publish-parser';const npmPublishOutput = `
npm notice 📦 [email protected]
npm notice Tarball Contents
npm notice 1.1kB LICENSE
npm notice 10.9kB README.md
npm notice 2.5kB bin.mjs
npm notice 6.2kB commands/swagger-to-ts.mjs
npm notice 1.0kB index.d.ts
npm notice 154B index.mjs
npm notice 606B lib/fs.mjs
npm notice 15.5kB lib/generate.mjs
npm notice 4.4kB lib/lite-lodash.mjs
npm notice 1.1kB lib/remove-title.mjs
npm notice 1.5kB package.json
npm notice Tarball Details
npm notice name: swaggered
npm notice version: 1.4.2
npm notice filename: swaggered-1.4.2.tgz
npm notice package size: 13.1 kB
npm notice unpacked size: 44.8 kB
npm notice shasum: 29908db791e8304d72dfde0171e128b0528d846b
npm notice integrity: sha512-d+HQGn+dgTvez[...]yu3nJZElZy30A==
npm notice total files: 11
`;const json = toJSON(npmPublishOutput);
```Parsed into well formed JSON structure:
```json
{
"tarballContents": [
{
"file": "LICENSE",
"size": "1.1kB"
},
{
"file": "README.md",
"size": "10.9kB"
},
{
"file": "bin.mjs",
"size": "2.5kB"
},
{
"file": "commands/swagger-to-ts.mjs",
"size": "6.2kB"
},
{
"file": "package.json",
"size": "1.5kB"
}
],
"tarballDetails": {
"name": "swaggered",
"version": "1.4.2",
"filename": "swaggered-1.4.2.tgz",
"packageSize": "13.1 kB",
"unpackedSize": "44.8 kB",
"shasum": "29908db791e1234572dfde0171e128b0528d846b",
"integrity": "sha512-d+HQGn+dgTvez[...]uvwxJZElZy30A==",
"totalFiles": 5
}
}
```