{"name":"nlcst-is-literal","version":"1.1.2","description":"Check whether an NLCST node is meant literally","license":"MIT","keywords":["nlcst","retext","util","utility","literal","word"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/nlcst-is-literal.git"},"bugs":{"url":"https://github.com/syntax-tree/nlcst-is-literal/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"}],"files":["index.js"],"dependencies":{"nlcst-to-string":"^2.0.0"},"devDependencies":{"browserify":"^16.0.0","esmangle":"^1.0.0","nyc":"^11.0.0","prettier":"^1.12.1","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","retext":"^5.0.0","tape":"^4.6.2","unist-util-visit":"^1.0.0","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js --bare -s nlcstIsLiteral > nlcst-is-literal.js","build-mangle":"esmangle < nlcst-is-literal.js > nlcst-is-literal.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":{"guard-for-in":"off","no-var":"off","prefer-arrow-callback":"off","unicorn/prefer-type-error":"off"},"ignore":["nlcst-is-literal.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"826d63198aa51c000225025b30894354d4912052","homepage":"https://github.com/syntax-tree/nlcst-is-literal#readme","_id":"nlcst-is-literal@1.1.2","_npmVersion":"6.0.0","_nodeVersion":"9.5.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-eFdFvG7XE/YwPFbRk3ryzinTVGWpAEBQNH/FWc4sVSHXUumZtdSVaJYsz0axK4uF1pmlIAWgYWhzDuQ8NTf79A==","shasum":"f941989ca46c6dfc635e96df6b25dcebdb2eb89d","tarball":"http://registry-npm.ywwl.com/nlcst-is-literal/download/nlcst-is-literal-1.1.2.tgz","fileCount":4,"unpackedSize":9274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6aXbCRA9TVsSAnZWagAAUfkP/izFlubWtmRTvwhwfHpi\nFyd6vy2jNY3JUZq8QYdhkmuzGWqcuMnJjIv8xtsJMTokix2ZICFBdLYPPAMB\nSeSBlhcnsNbY1porQjVs+uyc6RMVnI6EiojnQdgoVuK2ne9XD8jrh1gLDuHI\nL9ORhsRU5Ryj1sxvw/W19DPp/mdNELbZhtQy3uIWOdRTJyxqMQh5ZEe/WW4V\niOMpT0yxXViRutnOqlmc+a8dg3Pyp/hC7ztWiQ9BGPLMU+ltMDaAHX9yWLJ9\n6Bo4K2EzzQPySTT9+gn7BrQVfzMU7zmZHooL75xC2MiQq3FkWpuNRN6gmJnM\nb95IriJVRhi0+2RsUjNhqGhq5gD9Z3187VNylBAe3dTMMCDs2Ow2Acpz704u\nG7xpyTUU3O3+GaQSY0BD7M/6T0zcPmElJL83NKTbbJ4Xv4x+tuC1S4Rty6U4\nBvAfl9HmymZld1dW4Dgu8mY/bKBpJ3wAfAoZwJwWvM+Gi60/vDbadvC+IBoD\neC78N92HZP5c9cOE1i4S3Fnx33Qq6wYQOucME2WvyK4FHIlprcil0WK0LeIx\nXOtDta3eVd30v1HCFFb/u0f1MGbdEed+pIMrLI7xEAJDbNeRDtYH86DiDGxk\nvtc3Y64QrjYJArAKuTgcIRkvjAaHjHJA3qKrbnZD5lX4hrYpHJTdiheixfyj\nTPqB\r\n=NFuh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBjqFv89A4B6dDl6Y5AARN0O0e6Az522KmpNpX6LdLSAAiEA/CeY9GfEEY/fm+heHW/IPFbZxO/gv3uu3b78NyChmpg="}],"size":3573,"noattachment":false,"key":"/nlcst-is-literal/-/nlcst-is-literal-1.1.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nlcst-is-literal_1.1.2_1525261786441_0.8594137688196102"},"_hasShrinkwrap":false,"readme":"# nlcst-is-literal\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[nlcst][] utility to check if a node is meant literally.\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    *   [`isLiteral(parent, index|child)`](#isliteralparent-indexchild)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis utility can check if a node is meant literally.\n\n## When should I use this?\n\nThis package is a tiny utility that helps when dealing with words.\nIt’s useful if a tool wants to exclude values that are possibly void of\nmeaning.\nFor example, a spell-checker could exclude these literal words, thus not warning\nabout “monsieur”.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install nlcst-is-literal\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {isLiteral} from 'https://esm.sh/nlcst-is-literal@3'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {isLiteral} from 'https://esm.sh/nlcst-is-literal@3?bundle'\n</script>\n```\n\n## Use\n\nSay our document `example.txt` contains:\n\n```txt\nThe word “foo” is meant as a literal.\n\nThe word «bar» is meant as a literal.\n\nThe word (baz) is meant as a literal.\n\nThe word, qux, is meant as a literal.\n\nThe word — quux — is meant as a literal.\n```\n\n…and our module `example.js` looks as follows:\n\n```js\nimport {read} from 'to-vfile'\nimport {ParseEnglish} from 'parse-english'\nimport {visit} from 'unist-util-visit'\nimport {toString} from 'nlcst-to-string'\nimport {isLiteral} from 'nlcst-is-literal'\n\nconst file = await read('example.txt')\nconst tree = new ParseEnglish().parse(String(file))\n\nvisit(tree, 'WordNode', function (node, index, parent) {\n  if (isLiteral(parent, index)) {\n    console.log(toString(node))\n  }\n})\n```\n\n…now running `node example.js` yields:\n\n```txt\nfoo\nbar\nbaz\nqux\nquux\n```\n\n## API\n\nThis package exports the identifier [`isLiteral`][api-is-literal].\nThere is no default export.\n\n### `isLiteral(parent, index|child)`\n\nCheck if the child in `parent` at `index` is enclosed by matching delimiters.\n\nFor example, `foo` is literal in the following samples:\n\n*   `Foo - is meant as a literal.`\n*   `Meant as a literal is - foo.`\n*   `The word “foo” is meant as a literal.`\n\n###### Parameters\n\n*   `parent` ([`Node`][node])\n    — parent node\n*   `index` (`number`)\n    — index of child in parent\n*   `child` ([`Node`][node])\n    — child node of parent\n\n###### Returns\n\nWhether the child is a literal (`boolean`).\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\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, `nlcst-is-literal@^3`,\ncompatible with Node.js 16.\n\n## Related\n\n*   [`nlcst-normalize`](https://github.com/syntax-tree/nlcst-normalize)\n    — normalize a word for easier comparison\n*   [`nlcst-search`](https://github.com/syntax-tree/nlcst-search)\n    — search for patterns\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to get 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/syntax-tree/nlcst-is-literal/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/nlcst-is-literal/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/nlcst-is-literal.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/nlcst-is-literal\n\n[downloads-badge]: https://img.shields.io/npm/dm/nlcst-is-literal.svg\n\n[downloads]: https://www.npmjs.com/package/nlcst-is-literal\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=nlcst-is-literal\n\n[size]: https://bundlejs.com/?q=nlcst-is-literal\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/syntax-tree/unist/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[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[nlcst]: https://github.com/syntax-tree/nlcst\n\n[node]: https://github.com/syntax-tree/nlcst#nodes\n\n[api-is-literal]: #isliteralparent-indexchild\n","publish_time":1525261786515,"_cnpm_publish_time":1525261786515,"dist-tags":{"latest":"3.0.0"}}