{"name":"vfile-message","version":"2.0.1","description":"Create a virtual message","license":"MIT","keywords":["vfile","virtual","message"],"repository":{"type":"git","url":"git+https://github.com/vfile/vfile-message.git"},"bugs":{"url":"https://github.com/vfile/vfile-message/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"}],"types":"types/index.d.ts","dependencies":{"@types/unist":"^2.0.2","unist-util-stringify-position":"^2.0.0"},"devDependencies":{"browserify":"^16.0.0","dtslint":"^0.7.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","typescript":"^3.0.0","xo":"^0.24.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,"ignores":["vfile-message.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"4cb6235fc3a77b925db35893bc5cfc4ae2cb0e58","homepage":"https://github.com/vfile/vfile-message#readme","_id":"vfile-message@2.0.1","_nodeVersion":"12.2.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KtasSV+uVU7RWhUn4Lw+wW1Zl/nW8JWx7JCPps10Y9JRRIDeDXf8wfBLoOSsJLyo27DqMyAi54C6Jf/d6Kr2Bw==","shasum":"951881861c22fc1eb39f873c0b93e336a64e8f6d","tarball":"http://registry-npm.ywwl.com/vfile-message/download/vfile-message-2.0.1.tgz","fileCount":5,"unpackedSize":11765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc76W4CRA9TVsSAnZWagAAZ9sP/2zrYLSQ6ULlTd7fBNka\nKsgDSV+scZhJp+M5uMw2aTop/PnqIoaX+IpbaKJnoYupxCqpMva/AVf9dDpa\n5iZlA/dQbiQWo6kAedJ0DyaWnij6S98prTYruHgF5H6XcUYD2m8+gCEe0t66\nmGryY2sRIEvXCy0HUfwCOObNnYrMB37I8arzGwmTeoVyr1ihq5YkkrUKh4/K\nYFX6ECbxovLQjYbtanACoo1eD0qVl5ivwMV/DPn+8VVO9igKZahMQyLlb27X\nSw9YOsR7gD/wvoaJOsGc57MoQrWd06vto40yJ2RzUqhUzb6BplURrdLII9nU\nAVjIaU7jD2O0NXKMTMHhjvKRYPS61LRyT01I//MjLG0m2ZlSNHxqqXqJhzHz\n+QpBplnMFSIiyea+dG69+Ntn77kdxWmRf4jabAU9huigMCYyqiVfTKvsnbuT\nFYhUwWC/IcAEIUGlkhV/4zzLkE6vO/enbVl0h+PBlXPagVHqhMYM1lvx0ttx\nlmb0Y9HYcaL0DheLaSpBx5gaHgPZ2S14sUeNdAmys/bbfVbEDwMZsko8xujw\nAlevNVcq4Boz0UY3qBDp5NORVNXroTM2WB7ADc4HYhsZjVtNyzKksWP078qU\nmuVfze3bZt9DqXj2FKEw8DhUttC7Vn0oKAWSBTrPOShmci8GkMLY1MJqVm9E\nCWkc\r\n=5mnX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaWUjXG9s7aY29VEsrcP3QSJZSRrB6fK+eYQTSqFzRbwIgRdP1hJnZbnjeNsK39V/UM0oztnQ3fnX+PjHYcVR/TqM="}],"size":4467,"noattachment":false,"key":"/vfile-message/-/vfile-message-2.0.1.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.1_1559209399647_0.7939595895765494"},"_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":1559209399868,"_cnpm_publish_time":1559209399868,"dist-tags":{"latest":"4.0.4"}}