{"name":"vfile-message","version":"3.1.4","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"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"@types/unist":"^2.0.0","unist-util-stringify-position":"^3.0.0"},"devDependencies":{"@types/node":"^18.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.53.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"a174d9fc7cdd7f4ce3d48ceeecb01a02e18ef691","homepage":"https://github.com/vfile/vfile-message#readme","_id":"vfile-message@3.1.4","_nodeVersion":"19.3.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==","shasum":"15a50816ae7d7c2d1fa87090a7f9f96612b59dea","tarball":"http://registry-npm.ywwl.com/vfile-message/download/vfile-message-3.1.4.tgz","fileCount":7,"unpackedSize":18573,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJlRSGwVPKGCZguCQzfPfWLEr7Ehr2rOshohQ4FiBPogIhAKZuoD3qEHBbJDnAvn5N4RHJP5mWPy6aF4IAqzvp7fnz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4m+WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrn5Q//TNsFfZ2iVBy32eH81HDQjtlJfGiWt9SSi33jVl+YiFoGug8X\r\nj1jpGUS7LSipE4rA3FN6oGFXLDlboSEZGQ9QxW4CrV+KpABWCYCxNJjf3OxW\r\nAuAuNUDddSe36E5wgmqs8RAyec+zrO7ZxB79i67rzSqQ1VZuKiPXahI3hIqH\r\neUvZ52dLFvbd9ckHwS18tSWxbOY8Wy6dI0vbRAsEAReVFspvMTtQTMc/zWvm\r\nrNzGdy3GvHqJuwMSuC0OJeD8X3glngjh47bc4ImsjdCFIDfXldHyqhYju62p\r\n1uGKN6diwuVMUomLJkjq5fz4tDxEpJh/AzQRn8ZyxejB189oCDUcLFQXWd/2\r\nGIuXTvhY0kieUp3Y4zMAWmXg6zZyCSMbQVe8HP50ZzRwPU2HcQdpqtuINpCi\r\nrIRQnISmVidA0VYmT6N28Jq3IhVKsa+ZNUcGNVF8Aw+FhHdJg1xwTgg/hcJP\r\naXcFtesD7VRTOF+M46z6k3WcvpaRJe4Qt83iP5EpS/yT/A3wsJCRKlqm8S9r\r\nKb0LnBFlMlgUJm3S5RnGBjlYPG785J9yPyKGAZWvfJa4NL0lagRblnyc3RJb\r\nI83GMqNeGMNaYzSPlQo0Bg7/HkAtko225q1W13vPeQ6Gfl9Au8j/K4wuTd/j\r\n/1qHN8ZYJDTEMTIBsPtyLjTgr97XJeTE/kg=\r\n=DPFw\r\n-----END PGP SIGNATURE-----\r\n","size":5800,"noattachment":false,"key":"/vfile-message/-/vfile-message-3.1.4.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vfile-message_3.1.4_1675784086005_0.8097362893521727"},"_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":1675784086218,"_cnpm_publish_time":1675784086218,"dist-tags":{"latest":"4.0.4"}}