{"name":"vfile-statistics","version":"1.1.3","description":"Count vfile messages per category","license":"MIT","keywords":["vfile","message","count","statistics"],"repository":{"type":"git","url":"git+https://github.com/vfile/vfile-statistics.git"},"bugs":{"url":"https://github.com/vfile/vfile-statistics/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"Brendan Abbott","email":"brendan.abbott@temando.com"}],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","nyc":"^14.0.0","prettier":"^1.0.0","remark-cli":"^6.0.0","remark-preset-wooorm":"^5.0.0","tape":"^4.0.0","tinyify":"^2.0.0","vfile":"^4.0.0","xo":"^0.24.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.js\" && xo --fix","build-bundle":"browserify . -s vfileStatistics > vfile-statistics.js","build-mangle":"browserify . -s vfileStatistics -p tinyify > vfile-statistics.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run build && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false,"ignores":["vfile-statistics.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"05f4b0ec24ea38ce507dafc5f4342b67e5d4caf3","homepage":"https://github.com/vfile/vfile-statistics#readme","_id":"vfile-statistics@1.1.3","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-CstaK/ebTz1W3Qp41Bt9Lj/2DmumFsCwC2sKahDNSPh0mPh7/UyMLCoU8ZBX34CRU0d61B4W41yIFsV0NKMZeA==","shasum":"e9c87071997fbcb4243764d2c3805e0bb0820c60","tarball":"http://registry-npm.ywwl.com/vfile-statistics/download/vfile-statistics-1.1.3.tgz","fileCount":4,"unpackedSize":6765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc78V3CRA9TVsSAnZWagAAUE8P/jnhFIRwGGh2KrGB5vB5\nSerNzpKguWmSXwOP8kn2gDGsauXWzbqdDsEidkziqxC9HjopQndrHWzdujLf\n4SBGhDc3H92Lht6SdRsD4xcB1kfZ1Y3W1y0zGDhaFM8WnTFerMr/rfCg309E\nIUWQb0aK7eYR5lynm8TKe3fkTxnTd6Tg/vPKGmkAXu9mocDr3N/9OCZbnFuZ\nCb7vNWxJ7sDRIBvj8OIL4m3xFFjKsNrJ+ze6O5vYm63T/jq98iM4bWasUDtp\ndarDqKVh3uE9RS3Ie9tFtodk8ruVZnzXMRcwrEH9F61CDqcj+Z7HE/JFflfU\natjqhtPeBIFzmVQ3XfI2BIEmRER9ENr2J5Ddhegt0YLsuoDe3u2EjvOfa6X/\n9L75PRjq42ZBe0HjzugImoOhM++TC7UFn9ulyJSlnaCQdbEwi7m9pjFxNpgr\nSqBJw6wkbWhky5wA/HyvgVoNKCK9kp80VObzRJduFT5suU9oVNhodlpm/fpK\ngp89pj0xlBJpw1QVfc9aI2xsfUdf4BlEdFU4pz/wl1ST/nmFP/cw/34pjaT3\n/X0LfusHPBJsI+cxUFMs/pRThy/mjPbadbWpcUtxX64h8p3gQvcmhN3lLKPv\neXm/gAsWw+ZSPHDmIFV6Ku1N6D7CTGTsZOP0rGvU4yb23U4xUbRKkeSANVVy\nyWHP\r\n=CcOB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiZaV92q+Cy1ZU77S0o923SlTSxuWst/8ghYmmlt1TPgIhAOL5wXeU04Ecp/lmaACJ4K/kCGeJvxAM0CHcvzncx82y"}],"size":2911,"noattachment":false,"key":"/vfile-statistics/-/vfile-statistics-1.1.3.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vfile-statistics_1.1.3_1559217526564_0.08022535859401736"},"_hasShrinkwrap":false,"readme":"# vfile-statistics\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n[vfile][] utility to count messages per category (fatal, warn, info, etc).\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`statistics(file)`](#statisticsfile)\n    *   [`Statistics`](#statistics)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis tiny package gives you stats about messages in files.\n\n## When should I use this?\n\nThis is really tiny, you could do it yourself, but this is useful as a building\nblock.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install vfile-statistics\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {statistics} from 'https://esm.sh/vfile-statistics@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {statistics} from 'https://esm.sh/vfile-statistics@3?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {VFile} from 'vfile'\nimport {statistics} from 'vfile-statistics'\n\nconst file = new VFile({path: '~/example.md'})\n\nfile.message('This could be better')\nfile.message('That could be better')\n\ntry {\n  file.fail('This is terribly wrong')\n} catch {}\n\nfile.info('This is perfect')\n\nconsole.log(statistics(file))\n```\n\nYields:\n\n```js\n{fatal: 1, nonfatal: 3, warn: 2, info: 1, total: 4}\n```\n\n## API\n\nThis package exports the identifier [`statistics`][api-statistics].\nThere is no default export.\n\n### `statistics(file)`\n\nGet stats for a file, list of files, or list of messages.\n\n###### Parameters\n\n*   `file` ([`Array<VFile>`][vfile], [`Array<VFileMessage>`][vfile-message],\n    `VFile`, or `VFileMessage`)\n    — file, message, or list of files or messages\n\n###### Returns\n\nStatistics ([`Statistics`][api-statistics-map]).\n\n### `Statistics`\n\nStatistics (TypeScript type).\n\n###### Fields\n\n*   `fatal` — fatal errors (`fatal: true`)\n*   `warn` — warning messages (`fatal: false`)\n*   `info` — informational messages (`fatal: undefined`)\n*   `nonfatal` — warning or info messages\n*   `total` — all messages\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Statistics`][api-statistics-map].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `vfile-statistics@^3`,\ncompatible with Node.js 16.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to\nget started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/vfile/vfile-statistics/workflows/main/badge.svg\n\n[build]: https://github.com/vfile/vfile-statistics/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-statistics.svg\n\n[coverage]: https://codecov.io/github/vfile/vfile-statistics\n\n[downloads-badge]: https://img.shields.io/npm/dm/vfile-statistics.svg\n\n[downloads]: https://www.npmjs.com/package/vfile-statistics\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=vfile-statistics\n\n[size]: https://bundlejs.com/?q=vfile-statistics\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/vfile/vfile/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contributing]: https://github.com/vfile/.github/blob/main/contributing.md\n\n[support]: https://github.com/vfile/.github/blob/main/support.md\n\n[health]: https://github.com/vfile/.github\n\n[coc]: https://github.com/vfile/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[vfile]: https://github.com/vfile/vfile\n\n[vfile-message]: https://github.com/vfile/vfile-message\n\n[api-statistics]: #statisticsfile\n\n[api-statistics-map]: #statistics\n","publish_time":1559217526782,"_cnpm_publish_time":1559217526782,"dist-tags":{"latest":"3.0.0"}}