{"name":"vfile-statistics","version":"1.1.2","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":"^13.0.0","prettier":"^1.12.1","remark-cli":"^6.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","tinyify":"^2.4.3","vfile":"^3.0.0","xo":"^0.23.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,"rules":{"no-var":"off","prefer-arrow-callback":"off","object-shorthand":"off"},"ignores":["vfile-statistics.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"857da459c4f2446e230e5e64482f6219828d09eb","homepage":"https://github.com/vfile/vfile-statistics#readme","_id":"vfile-statistics@1.1.2","_npmVersion":"6.4.1","_nodeVersion":"11.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-16wAC9eEGXdsD35LX9m/iXCRIZyX5LIrDgDtAF92rbATSqsBRbC4n05e0Rj5vt3XRpcKu0UJeWnTxWsSyvNZ+w==","shasum":"c50132627e4669a3afa07c64ff1e7aa7695e8151","tarball":"http://registry-npm.ywwl.com/vfile-statistics/download/vfile-statistics-1.1.2.tgz","fileCount":4,"unpackedSize":6271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8wgaCRA9TVsSAnZWagAAErIP/0g8mdIgoM2KpKNA/xH2\ne1prBnXuB6D7ejNjvCoSF0T3fN70Gv42JHm6jUxpzE4tWtzT5qvcgzz9y+/a\nMLdBjI1AJ4/Dt+k1x+2wat5u05OKFJw9QCWFRrhHFJq8Oah3e6pxu3AAfgbd\nXMlMo+gAId6Guq4Ga56enSrDisQnrx40/k1bzk8PlnNuBbbwDMOw8F2S9jRs\nEqeEcsaO6wgLCp3boZSWME+vB9Y333CFqLKgVOyZTJ6Lx7Jwi98OnDRqXJjs\nFvSN6wwhwIQYwujcHlfLUTe89UIeqSSvUMhE6VSIwMuu6PBOAlpmXk8h94e0\nwJBqmUWyqshf7fW3iZPhqEfb0rpCo8miIE8WpLb1dLDaLJzLQwclp7VfJfZV\ni0Qt+KlF5LkkCznH3HdTA1HszB8JU3k+PFHPE/S2iYFp8hqsdOJX6SxfeuTQ\n38MXjJuzSgVvyxQUJ2vCfICcJl1He5LgVeM4Ux32iZp0FRte0Xohpup0YnSA\nQDWgP5/hJtsIGjQx4lzMg9jMDgXkB//CSRQH04VsUBhKpgE+2JH2fBkFa8hz\npRG5kbDub+AaigBzc52Qfjlo1RGdplNsYoLc/37kMx92yKASAOWwNX+z30ml\npdUkOTiXUOjrPaY+wfd6pbDaaFdpEmagKEFaJRuXVdDQgYP475JsTAzFrdLR\n+Rzt\r\n=v6vW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+WaD0tm4HMhKy49Zz5wKOzaYSf0aIjmTw1/y7jXPSoAiEAj+x/KLystz5fN2dxYhmoVIWeZ7UZ8KAo5xSr1nm83Eo="}],"size":2810,"noattachment":false,"key":"/vfile-statistics/-/vfile-statistics-1.1.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vfile-statistics_1.1.2_1542653977366_0.3562127107158555"},"_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":1542653977477,"_cnpm_publish_time":1542653977477,"dist-tags":{"latest":"3.0.0"}}