{"name":"direction","version":"2.0.1","description":"Detect the direction of text: left-to-right, right-to-left, or neutral","license":"MIT","keywords":["writing","system","direction","directionality","rtl","ltr","cli","bin"],"repository":{"type":"git","url":"git+https://github.com/wooorm/direction.git"},"bugs":{"url":"https://github.com/wooorm/direction/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"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","bin":{"direction":"cli.js"},"types":"index.d.ts","devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","prettier":"^2.0.0","remark-cli":"^10.0.0","remark-preset-wooorm":"^9.0.0","rimraf":"^3.0.0","tape":"^5.0.0","type-coverage":"^2.0.0","typescript":"^4.0.0","xo":"^0.46.0"},"scripts":{"prepublishOnly":"npm run build && npm run format","build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 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":"905614fe903c80016148390e279eed316a3c1339","homepage":"https://github.com/wooorm/direction#readme","_id":"direction@2.0.1","_nodeVersion":"17.0.1","_npmVersion":"8.1.0","dist":{"integrity":"sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==","shasum":"71800dd3c4fa102406502905d3866e65bdebb985","tarball":"http://registry-npm.ywwl.com/direction/download/direction-2.0.1.tgz","fileCount":6,"unpackedSize":8716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2oQPCRA9TVsSAnZWagAAjTYQAJ8vvzgL7FEurxg8C1G+\n9nqcn4WrURFCuBLFG9Yo3IsoKf2e85z02MV0vXBB6uh4ApVHuvXX0iEbDsO3\nHbJknuDBeDb7ueqi70IiLw6YCCZspGP4BBPTvZM3N+wYjZ7USekVWbwc5q7g\nvkPGZ8rlDXSGZ7gbJ/MRvAALt4UOiONsVrf+33I2kINXChbe8encGl8WWqMZ\nmcNXESSJDNhxlHQk34eUsAu2UX/7WDfHYdke2INkz/Y1wUUG6j9BwSXTIjel\nGfhqPHE/VuKxgdY5/WU+yu2YaN8YIzhbnLrCdgJL8/Xcaxciqy4fuztA+Me7\nO5b2+4VQ6Ko4WH8vRMtn0HaNC3YTQoX6vUkHMX1lKJlMUuufyYIg9FzSMIYd\nSiazLnLEa02Fq7U+wQN5k8s/puw7atVeXzSgrCjbn7nVL/a/eKTef9GpNzju\n3jsND9Y4UAfpmeg3XTvTeuJ4mb7xI90muHJ2hxu0Ki7jSfBdkE3ohDVrVhmG\n0F+T1/z6RNgSHCNjChg6/uTcCSw5kPSpTY7ssDb2E/nTwlYolRpag7SbuZ0Y\ndb++m/4RQXXPCnSv3qza3veMgxy/fgWBTriP9UGg+rRdPZtCqrX5Iv96gy8Y\n9uFmaGllU835PyO0loT/HW5/oVXD3kCQTU43u8l1VzBr8elQROJePb7macs/\n4f6k\r\n=gplw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDMGtzAy3TRDrPqOmHSGQ/eO+LiCaf0msl1gsBDl+HvfAiEA88Uk2UfkxFmcUwcqvJs6m8ub/wUPCGCcwvFxAJbL/AM="}],"size":3801,"noattachment":false,"key":"/direction/-/direction-2.0.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/direction_2.0.1_1636269867084_0.7792433653583999"},"_hasShrinkwrap":false,"readme":"# direction\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nDetect the direction of text: left-to-right, right-to-left, or neutral.\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    *   [`direction(value)`](#directionvalue)\n*   [CLI](#cli)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package detects whether text is written left-to-right or right-to-left.\n\n## When should I use this?\n\nThis is a simple and fast algorithm.\nIt looks at the first strong left-to-right or right-to-left character (for\nexample, the letter `a` is LTR, the letter `ى` is RTL).\nThat’s often enough but might be too naïve as it doesn’t take percentages or so\ninto account.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:\n\n```sh\nnpm install direction\n```\n\nIn Deno with [Skypack][]:\n\n```js\nimport {direction} from 'https://cdn.skypack.dev/direction@2?dts'\n```\n\nIn browsers with [Skypack][]:\n\n```html\n<script type=\"module\">\n  import {direction} from 'https://cdn.skypack.dev/direction@2?min'\n</script>\n```\n\n## Use\n\n```js\nimport {direction} from 'direction'\n\ndirection('A') // => 'ltr'\ndirection('anglais') // => 'ltr'\ndirection('بسيطة') // => 'rtl'\ndirection('@') // => 'neutral'\n```\n\n## API\n\nThis package exports the following identifier: `direction`.\nThere is no default export.\n\n### `direction(value)`\n\nDetect the direction of `value` (`string?`).\nReturns `'ltr'`, `'rtl'`, or `'neutral'`.\n\n## CLI\n\n```txt\nUsage: direction [options] <words...>\n\nDetect the direction of text: left-to-right, right-to-left, or neutral\n\nOptions:\n\n  -h, --help           output usage information\n  -v, --version        output version number\n\nUsage:\n\n# output directionality\n$ direction @\n# neutral\n\n# output directionality from stdin\n$ echo 'الانجليزية' | direction\n# rtl\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nThere are no extra exported types.\n\n## Compatibility\n\nThis package is at least compatible with all maintained versions of Node.js.\nAs of now, that is Node.js 12.20+, 14.14+, and 16.0+.\nIt also works in Deno and modern browsers.\n\n## Security\n\nThis package is safe.\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/wooorm/direction/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/direction/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/direction.svg\n\n[coverage]: https://codecov.io/github/wooorm/direction\n\n[downloads-badge]: https://img.shields.io/npm/dm/direction.svg\n\n[downloads]: https://www.npmjs.com/package/direction\n\n[size-badge]: https://img.shields.io/bundlephobia/minzip/direction.svg\n\n[size]: https://bundlephobia.com/result?p=direction\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[skypack]: https://www.skypack.dev\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n","publish_time":1636269867217,"_cnpm_publish_time":1636269867217,"dist-tags":{"latest":"2.0.1"}}