{"_id":"@delucis/reading-data-text-stats","_rev":"3-7fcbb0c7a9e2b134bb0ca2cac5290fb9","name":"@delucis/reading-data-text-stats","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@delucis/reading-data-text-stats","version":"0.1.0","author":{"url":"http://chrisswithinbank.net/","name":"Chris Swithinbank","email":"swithinbank@gmail.com"},"license":"GPL-3.0","_id":"@delucis/reading-data-text-stats@0.1.0","maintainers":[{"name":"delucis","email":"swithinbank@gmail.com"}],"homepage":"https://github.com/delucis/reading-data-text-stats#readme","bugs":{"url":"https://github.com/delucis/reading-data-text-stats/issues"},"dist":{"shasum":"8edc54f1ed59750408c95e6bc0ed57304ca8af8d","tarball":"https://registry.npmjs.org/@delucis/reading-data-text-stats/-/reading-data-text-stats-0.1.0.tgz","integrity":"sha512-1j89sTMp5r8c6oBo0tNs09Sh0n/DeFXtNyyZ42xMYK2vzB5o4Kb39vBAi00X7cWDS9mH7HbREtANSKnfbfwNkw==","signatures":[{"sig":"MEUCIFkH0Om1+Qm3obc5OTKd2NTyIFIAN3QO79/svwBYKtfrAiEA0uzzLIH7jKYOMllWVkYs8NfGaRh85hhRODy5fTy7Rc0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","gitHead":"bbb8990b3f833e25b40513719e3618cec0268bd4","scripts":{"test":"nyc mocha --reporter spec","version":"npm run clean:docs && npm run build:docs && git add -A docs","coverage":"nyc report --reporter=text-lcov | coveralls","build:docs":"jsdoc --configure .jsdoc.json --verbose","clean:docs":"rimraf docs/","preversion":"npm run test","postversion":"git push --follow-tags"},"_npmUser":{"name":"delucis","email":"swithinbank@gmail.com"},"repository":{"url":"git+https://github.com/delucis/reading-data-text-stats.git","type":"git"},"_npmVersion":"5.4.0","description":"Text statistics plugin for @delucis/reading-data.","_nodeVersion":"8.4.0","dependencies":{"strip":"^3.0.0","franc-min":"^3.1.1","@iarna/word-count":"^1.0.3"},"devDependencies":{"nyc":"^11.1.0","chai":"^4.1.1","jsdoc":"^3.5.4","mocha":"^3.5.0","minami":"^1.2.3","rimraf":"^2.6.1","coveralls":"^2.13.1","@delucis/reading-data":"^0.7.1"},"_npmOperationalInternal":{"tmp":"tmp/reading-data-text-stats-0.1.0.tgz_1503837476754_0.5521851521916687","host":"s3://npm-registry-packages"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2017-08-27T12:37:59.036Z","modified":"2025-03-12T12:19:38.660Z","0.1.0":"2017-08-27T12:37:59.036Z"},"bugs":{"url":"https://github.com/delucis/reading-data-text-stats/issues"},"author":{"url":"http://chrisswithinbank.net/","name":"Chris Swithinbank","email":"swithinbank@gmail.com"},"license":"GPL-3.0","homepage":"https://github.com/delucis/reading-data-text-stats#readme","repository":{"url":"git+https://github.com/delucis/reading-data-text-stats.git","type":"git"},"description":"Text statistics plugin for @delucis/reading-data.","maintainers":[{"name":"delucis","email":"swithinbank@gmail.com"}],"readme":"# @delucis/reading-data-text-stats\n\n[![Build Status](https://travis-ci.org/delucis/reading-data-text-stats.svg?branch=master)](https://travis-ci.org/delucis/reading-data-text-stats)\n[![Coverage Status](https://coveralls.io/repos/github/delucis/reading-data-text-stats/badge.svg?branch=master)](https://coveralls.io/github/delucis/reading-data-text-stats?branch=master)\n[![npm (scoped)](https://img.shields.io/npm/v/@delucis/reading-data-text-stats.svg)](https://www.npmjs.com/package/@delucis/reading-data-text-stats)\n\nA plugin for [`@delucis/reading-data`](https://github.com/delucis/reading-data)\nthat processes a string of text returning statistics such as word count and\nlanguage.\n\n\n## Installation\n\n```sh\nnpm install --save @delucis/reading-data-text-stats\n```\n\n\n## Usage\n\n```js\nconst RD = require('@delucis/reading-data')\nconst TEXT_STATS = require('@delucis/reading-data-text-stats')\n\nRD.preloadData({\n  myArticle: { text: 'This is a short article that needs analysing.' }\n})\n\nRD.use(TEXT_STATS, {\n  scope: 'myArticle',\n  textNode: 'text',     // where in the scope is the text to analyse\n  outNode: 'stats'      // where in the scope should the output be saved\n})\n\nRD.run().then((res) => {\n  console.log(res.data.myArticle.stats)\n  // logs: { wordcount: 8, language: 'eng' }\n})\n```\n\n\n## Options\n\nname        | type               | default       | description\n------------|--------------------|---------------|------------------------------\n`hooks`     | `String`, `Object` | `'process'`   | The `reading-data` hook that should load the YAML file. Can be scoped by passing an object with scopes as keys, hooks as values.\n`language`  | `Boolean`          | `true`        | Whether or not the plugin should return the language of the `textNode`.\n`outNode`   | `String`           | `'stats'`     | The property to be added to the scope containing text statistics.\n`scope`     | `String`, `Array`  | `'textStats'` | The scope under which `reading-data` will store this plugin’s data. Can be an array to return multiple filepaths/URLs, to multiple scopes.\n`stripHTML` | `Boolean`          | `false`       | Whether or not the plugin should try to strip HTML tags from the `textNode`.\n`textNode`  | `String`           | `'text'`      | The property in the `scope` that contains the string to be analysed.\n`wordcount` | `Boolean`          | `true`        | Whether or not the plugin should return how many words are in the `textNode`.\n","readmeFilename":"README.md"}