{"name":"direction","version":"1.0.2","description":"Detect directionality: 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"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"bin":{"direction":"cli.js"},"files":["index.js","cli.js"],"dependencies":{},"devDependencies":{"browserify":"^16.0.0","esmangle":"^1.0.0","execa":"^0.9.0","nyc":"^11.0.0","prettier":"^1.12.1","remark-cli":"^5.0.0","remark-preset-wooorm":"^4.0.0","tape":"^4.4.0","xo":"^0.20.0"},"scripts":{"format":"remark . -qfo && prettier --write '**/*.js' && xo --fix","build-bundle":"browserify index.js -s direction > direction.js","build-mangle":"esmangle direction.js > direction.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":{"no-var":"off","object-shorthand":"off","prefer-arrow-callback":"off"},"ignores":["direction.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"065e016d822e6554876ec732a47557fdc4bc09a8","homepage":"https://github.com/wooorm/direction#readme","_id":"direction@1.0.2","_npmVersion":"6.0.0","_nodeVersion":"9.5.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-hSKoz5FBn+zhP9vWKkVQaaxnRDg3/MoPdcg2au54HIUDR8MrP8Ah1jXSJwCXel6SV3Afh5DSzc8Uqv2r1UoQwQ==","shasum":"ac49c4699edf1283fd82f34e701ca668ea4883b9","tarball":"http://registry-npm.ywwl.com/direction/download/direction-1.0.2.tgz","fileCount":5,"unpackedSize":5831,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa5cANCRA9TVsSAnZWagAA2pUP/1koJP8M/3tVl2LCRWLF\nFtE9WHFrASEeWmLKCYe6dy54gPxutteXXSmYFTdfVnd9a2pFb1TvCMQfEd4K\nBQMjRt+Bq+9tbHdAQgIksLHqoqQyB2vBNieIiSTSQGebJJhKeOmmjJ42mHqH\nwYMeQby+nUi7nNTKMNELlsihxdM4y7hQQfF54qbGQ+R9WJhgC9kRkBKeuJjQ\ned2NAmrUnTSSafXKfVbX0qfaZljhMNj9ckiyTHUEO8JrWx8hAcz37BV7hvHM\nJSh3QYGS+DEgaCEiyRfoyAN9ImW7XZVCYzjTloyiZTp1fGC+Pa2kg+DGWJn1\nSXfv23R3QEAkr7DV3Mqg4wLpyY41tM2l5W0hjNZvXhErWP1IRLtAlrSoWD52\nWtQLoZmQbG4T8yjjmQBMx1PR6zMzdbsIszU42TL8XhH9ol7hAmT4PEW3TDAH\nuH1N9lQTC5SUQKmrflnxSlSJETcT8sPF5oz/0ajSN+1KQJCABQWvcceAKsUf\nam+sp+MQz/FXk7sQ+RNZ9fiq5UyV4rbLMISmPFfhhD81vyhRZwxezCDBcwpR\nwWM0I8cP30n+Q38c6edVAfGLb8irFoVc4BPfrrtKhdYoXh7BERSFA1oMVgMx\n2scYsIaVOgx7x9sWBQ+abmNVftBjSzMv2WTIx36AredHY29px43CAPoOihZo\nd3ba\r\n=wByQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICoUSYruUrj3eldPDa2nUZcEmkgCXJP5egZJ/r5tfgbLAiAJBg+0hjMd+gJeOtwkR6l0xAFpRQEZ/SyVUNCdV/yIgQ=="}],"size":2672,"noattachment":false,"key":"/direction/-/direction-1.0.2.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/direction_1.0.2_1525006348473_0.07640845705021349"},"_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":1525006348525,"_cnpm_publish_time":1525006348525,"dist-tags":{"latest":"2.0.1"}}