{"name":"vfile-message","version":"2.0.3","description":"vfile utility to create a virtual message","license":"MIT","keywords":["vfile","vfile-util","util","utility","virtual","file","message"],"repository":{"type":"git","url":"git+https://github.com/vfile/vfile-message.git"},"bugs":{"url":"https://github.com/vfile/vfile-message/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"types":"types/index.d.ts","dependencies":{"@types/unist":"^2.0.0","unist-util-stringify-position":"^2.0.0"},"devDependencies":{"browserify":"^16.0.0","dtslint":"^3.0.0","nyc":"^15.0.0","prettier":"^1.0.0","remark-cli":"^7.0.0","remark-preset-wooorm":"^6.0.0","tape":"^4.0.0","tinyify":"^2.0.0","xo":"^0.27.0"},"scripts":{"format":"remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix","build-bundle":"browserify . -s vfileMessage > vfile-message.js","build-mangle":"browserify . -s vfileMessage -p tinyify > vfile-message.min.js","build":"npm run build-bundle && npm run build-mangle","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test-types":"dtslint types","test":"npm run format && npm run build && npm run test-coverage && npm run test-types"},"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":{"@typescript-eslint/member-ordering":"off"},"ignores":["vfile-message.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"374827b45c13554f3641398fad2accaa4c662e2a","homepage":"https://github.com/vfile/vfile-message#readme","_id":"vfile-message@2.0.3","_nodeVersion":"13.9.0","_npmVersion":"6.13.7","dist":{"integrity":"sha512-qQg/2z8qnnBHL0psXyF72kCjb9YioIynvyltuNKFaUhRtqTIcIMP3xnBaPzirVZNuBrUe1qwFciSx2yApa4byw==","shasum":"0dd4f6879fb240a8099b22bd3755536c92e59ba5","tarball":"http://registry-npm.ywwl.com/vfile-message/download/vfile-message-2.0.3.tgz","fileCount":5,"unpackedSize":11956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeXhFLCRA9TVsSAnZWagAACd0P/izaiE9VHA+noTamjDMC\nJCzMyJvGwu5UAAiMe33881L9Oxs/iW3ndmxwppRhbzdTYxCIXU7VMtwJONQu\nONTTDUcelAm0oyVKf9lrGO2E6AlcriFfZ8p01zT6LT1JK+rRprGAK8nVcgUT\n4vrwycX9InsYcHxRKr0ULSeOEMlL4sfv51GYP2G1R4wRYGcDgEhrO7hyZk9z\nYytF+hBonMeZpf7xsKZfDj03CJSTgRY4JFdMSArErYA6uDKFq3WlX14peUUX\nrDsESl7J6zo2KpkJUvhZS5iWLixY9iS5MVyZ+3HPpMFnQLzpf78TjcPPwQk5\nFAy3J5dItLGLNlGaJeKALzsA2jiZAmYGVxRFTx2hza9KjVHxFDIg/oRfp26c\nJuhh6qmqGHR93g0KfXbMajoD2/1nDExv4lGjwomcKRSlmBgw9nRtndqF7QF9\n2e+CGkl1T8sUfBXvcDakt+RsQRiH8GrIn+Gq2S5rj0/GAiLo2ZHN7WnKfPCU\nA7sDl+4kB8dmdcW3gYPKqbI73rtT0HBz2Ea62eW0iINGlmlBh5MdNvgK/So8\nW9E3qGNWhErb5Y6CuGXNLgsgYmhkScxDGGjWzJC4OTtdjXwiUZebIOw3x8LM\nkUiSSQd+8302spwWDkQnSFKj2AAJ+bYL7o2Qho0hUrjOHl1lAAccuKGpT03d\nENXI\r\n=oEtr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEKfo+WpGE/j37E/BODH46Kw248Az+lklxjhT+dJ+vk8AiAxwHHyWde45MP79ebxFeFBcm+BlPW2jKigF9JnnSFbUg=="}],"size":4530,"noattachment":false,"key":"/vfile-message/-/vfile-message-2.0.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-message_2.0.3_1583223114499_0.2203684237709045"},"_hasShrinkwrap":false,"readme":"# vfile-message\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\nCreate [vfile][] messages.\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    *   [`VFileMessage(reason[, options])`](#vfilemessagereason-options)\n    *   [`Options`](#options)\n    *   [Well-known](#well-known)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package provides a (lint) message format.\n\n## When should I use this?\n\nIn most cases, you can use `file.message` from `VFile` itself, but in some\ncases you might not have a file, and still want to emit warnings or errors,\nin which case this can be used directly.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install vfile-message\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {VFileMessage} from 'https://esm.sh/vfile-message@4'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {VFileMessage} from 'https://esm.sh/vfile-message@4?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {VFileMessage} from 'vfile-message'\n\nconst message = new VFileMessage(\n  'Unexpected unknown word `braavo`, did you mean `bravo`?',\n  {source: 'spell', ruleId: 'typo', place: {line: 1, column: 8}}\n)\n\nconsole.log(message)\n```\n\nYields:\n\n```txt\n[1:8: Unexpected unknown word `braavo`, did you mean `bravo`?] {\n  reason: 'Unexpected unknown word `braavo`, did you mean `bravo`?',\n  line: 1,\n  column: 8,\n  ancestors: undefined,\n  cause: undefined,\n  fatal: undefined,\n  place: {line: 1, column: 8},\n  ruleId: 'typo',\n  source: 'spell'\n}\n```\n\n## API\n\nThis package exports the identifier [`VFileMessage`][api-vfile-message].\nThere is no default export.\n\n### `VFileMessage(reason[, options])`\n\nCreate a message for `reason`.\n\n> 🪦 **Note**: also has obsolete signatures.\n\n###### Parameters\n\n*   `reason` (`string`)\n    — reason for message (should use markdown)\n*   `options` ([`Options`][api-options], optional)\n    — configuration.\n\n###### Extends\n\n[`Error`][mdn-error].\n\n###### Returns\n\nInstance of `VFileMessage`.\n\n###### Fields\n\n*   `ancestors` ([`Array<Node>`][unist-node] or `undefined`)\n    — stack of (inclusive) ancestor nodes surrounding the message\n*   `cause` ([`Error`][mdn-error] or `undefined`)\n    — original error cause of the message\n*   `column` (`number` or `undefined`)\n    — starting column of message\n*   `fatal` (`boolean` or `undefined`)\n    — state of problem; `true`: error, file not usable; `false`: warning,\n    change may be needed; `undefined`: info, change likely not needed\n*   `line` (`number` or `undefined`)\n    — starting line of message\n*   `place` ([`Point`][unist-point], [`Position`][unist-position] or `undefined`)\n    — place of message\n*   `reason` (`string`)\n    — reason for message (should use markdown)\n*   `ruleId` (`string` or `undefined`, example: `'my-rule'`)\n    — category of message\n*   `source` (`string` or `undefined`, example: `'my-package'`)\n    — namespace of message\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n*   `ancestors` ([`Array<Node>`][unist-node], optional)\n    — stack of (inclusive) ancestor nodes surrounding the message\n*   `cause` ([`Error`][mdn-error], optional)\n    — original error cause of the message\n*   `place` ([`Point`][unist-point] or [`Position`][unist-position], optional)\n    — place of message\n*   `ruleId` (`string`, optional, example: `'my-rule'`)\n    — category of message\n*   `source` (`string`, optional, , example: `'my-package'`)\n    — namespace of who sent the message\n\n### Well-known\n\nIt’s OK to store custom data directly on the `VFileMessage`, some of those are\nhandled by [utilities][util].\nThe following fields are documented and typed here.\n\n###### Fields\n\n*   `actual` (`string`, optional)\n    — specify the source value that’s being reported, which is deemed incorrect\n*   `expected` (`Array<string>`, optional)\n    — suggest acceptable values that can be used instead of `actual`\n*   `url` (`string`, optional)\n    — link to docs for the message (this must be an absolute URL that can be\n    passed as `x` to `new URL(x)`)\n*   `note` (`string`, optional)\n    — long form description of the message (you should use markdown)\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\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-message@^4`,\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-message/workflows/main/badge.svg\n\n[build]: https://github.com/vfile/vfile-message/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg\n\n[coverage]: https://codecov.io/github/vfile/vfile-message\n\n[downloads-badge]: https://img.shields.io/npm/dm/vfile-message.svg\n\n[downloads]: https://www.npmjs.com/package/vfile-message\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=vfile-message\n\n[size]: https://bundlejs.com/?q=vfile-message\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[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[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[mdn-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\n\n[unist-node]: https://github.com/syntax-tree/unist#node\n\n[unist-point]: https://github.com/syntax-tree/unist#point\n\n[unist-position]: https://github.com/syntax-tree/unist#position\n\n[vfile]: https://github.com/vfile/vfile\n\n[util]: https://github.com/vfile/vfile#utilities\n\n[api-options]: #options\n\n[api-vfile-message]: #vfilemessagereason-options\n","publish_time":1583223114663,"_cnpm_publish_time":1583223114663,"dist-tags":{"latest":"4.0.4"}}