{"name":"vfile-statistics","version":"1.1.1","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":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},{"name":"Brendan Abbott","email":"brendan.abbott@temando.com"}],"files":["index.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","esmangle":"^1.0.1","nyc":"^11.0.0","prettier":"^1.12.1","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.0.0","vfile":"^2.0.0","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js --bare -s vfileStatistics > vfile-statistics.js","build-mangle":"esmangle vfile-statistics.js > 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":"099d8a6a39369bda3ea99270291f3af90a4b1055","homepage":"https://github.com/vfile/vfile-statistics#readme","_id":"vfile-statistics@1.1.1","_npmVersion":"6.0.0","_nodeVersion":"9.5.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-dxUM6IYvGChHuwMT3dseyU5BHprNRXzAV0OHx1A769lVGsTiT50kU7BbpRFV+IE6oWmU+PwHdsTKfXhnDIRIgQ==","shasum":"a22fd4eb844c9eaddd781ad3b3246db88375e2e3","tarball":"http://registry-npm.ywwl.com/vfile-statistics/download/vfile-statistics-1.1.1.tgz","fileCount":4,"unpackedSize":5951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa62ekCRA9TVsSAnZWagAAjtcP/R7xBbB5lL9NmxY2EgEM\nh2HqDLx9x04H/UgG4CJg6zn1icR/eaCkAlBdGvybfPRuLwZwY2MWI6eUV51X\nR3yVziL+ElWkHPyDLmHeTfMO0J58KRqgxr1CbMsxMQuCjJG/5RmHLZNjm325\nSz2gvr3U79c7mim5HnEqhpLUxPLqg5KElAKkKXIhpA2FtAxfaFEIUUYEZX60\nUr1d9JwifGTROhPQIcvny+MqR335bb9UehEsAFkxekbdN3p9PX6vj7i6iYSR\n6KQgUubHYoRF8X/lV+npZd3gpkXRZTdOGUUL1GbST3nHbAaUNZW0p3WeA3Rq\nBEHlUsQ9gzxAEqb9ZYsivmL5vA3/1QSvgjofLD4T3g+W3soUub2lwvlAaFWC\n7re9ALDMphK0h/ax3rDz8Q04gMSsfGjTggMlqYGeyW5z6A0kw+ZlbZNpfXTa\nKlMKS0yGECvSem4J0YyNyKfJUP06UdGwZ9c1IGc+hKMuUAAiXD4Zh2WeQdXp\nICQZJ1K4C6PoT1uc2KPAgEJU0mHjI1UJiLcfhBnMx+LDuUNiE8um7cJXamgW\n57670KyHjQH1S+lCKMYy6A3epoYtRzn4YHr4EMs+URPlBDEZkyyZGAblsUUV\nvpZvi1qMsy23wCBzYKXKrLE5Kh9+eCNNbtxKt8lJG0DpECsp42FyxJ8GJvk/\nN62D\r\n=z1WF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjvca5LR1ICkzoiDWb3CfpCVJ1quT5nSKnOv7Xj1+qXAiAGYt2FFLzPqGt/Gp6DX162VC0jWt+ShNXdwUQ0wURx3g=="}],"size":2714,"noattachment":false,"key":"/vfile-statistics/-/vfile-statistics-1.1.1.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vfile-statistics_1.1.1_1525376931177_0.67744887222955"},"_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":1525376931267,"_cnpm_publish_time":1525376931267,"dist-tags":{"latest":"3.0.0"}}