{"_id":"countable","_rev":"13-b70ddeedd37c55efb43a41625155fa84","name":"countable","description":"Countable is a JavaScript library to add live paragraph-, word- and character-counting to an HTML element.","dist-tags":{"latest":"3.0.1"},"versions":{"2.0.2":{"name":"countable","description":"Countable is a JavaScript function to add live paragraph-, word- and character-counting to an HTML element.","author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"version":"2.0.2","main":"Countable.js","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"https://github.com/RadLikeWhoa/Countable.git"},"devDependencies":{"chai":"^1.9.1","karma":"^0.12.21","karma-chai":"^0.1.0","karma-firefox-launcher":"^0.1.3","karma-mocha":"^0.1.7","karma-phantomjs-launcher":"^0.1.4","mocha":"^1.21.4"},"scripts":{"test":"./node_modules/karma/bin/karma start"},"license":"MIT","gitHead":"7fe691946e1b3413758b0f9d77156b0b4d87aa4f","bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"homepage":"https://github.com/RadLikeWhoa/Countable","_id":"countable@2.0.2","_shasum":"a125367a8e9ecd06b2d10b911cdffbc48472cf07","_from":"./","_npmVersion":"1.4.21","_npmUser":{"name":"sachaschmid","email":"schmid.sacha@gmail.com"},"maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"dist":{"shasum":"a125367a8e9ecd06b2d10b911cdffbc48472cf07","tarball":"https://registry.npmjs.org/countable/-/countable-2.0.2.tgz","integrity":"sha512-GFfCEWT/zbT1O5SODS0aYtlxmn1vcQ/eUNxxzT5PAWDr9uQltkcTnW+rPnszB6U66wENXDNaaPGYlrOJbP/1nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXvsGUtPtnu0gluWFrmw8v0cVvP0/h48tDfpU1/bvfhAiBjVHfZ6PfcxZlvrBCQUOUMVaJ5+08kr/zPMEW/D8PNnA=="}]},"directories":{}},"2.1.0":{"name":"countable","description":"Countable is a JavaScript library to add live paragraph-, word- and character-counting to an HTML element.","author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"version":"2.1.0","main":"Countable.js","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"https://github.com/RadLikeWhoa/Countable.git"},"devDependencies":{"chai":"^1.9.1","karma":"^0.12.21","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-mocha":"^0.1.7","mocha":"^1.21.4"},"scripts":{"test":"./node_modules/karma/bin/karma start"},"license":"MIT","gitHead":"957c2aa01dccdba7f37de314401f856a6742bcc2","bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"homepage":"https://github.com/RadLikeWhoa/Countable","_id":"countable@2.1.0","_shasum":"9c64f5da37eb6aabb543f30bb6e9a73546475379","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"sachaschmid","email":"schmid.sacha@gmail.com"},"maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"dist":{"shasum":"9c64f5da37eb6aabb543f30bb6e9a73546475379","tarball":"https://registry.npmjs.org/countable/-/countable-2.1.0.tgz","integrity":"sha512-qYazfybjCJoehBTloNnURlakIRfSxmrxM2HSMOtl9vn/4s3hb1ZWiUPVk4FD5NaC/89hBqWfYuKf4FKsWlwt+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsm0IxbVrLK3YmSrep1nXCE07YCT7pQS0JdAm0Ae+AZwIhAIILBnjfvLqLCYLhHORBxXfUG7DK0QIxQa7SUd7TvO9n"}]},"directories":{}},"2.1.1":{"name":"countable","description":"Countable is a JavaScript library to add live paragraph-, word- and character-counting to an HTML element.","author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"version":"2.1.1","main":"Countable.js","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"https://github.com/RadLikeWhoa/Countable.git"},"devDependencies":{"chai":"^1.9.1","karma":"^0.12.21","karma-chai":"^0.1.0","karma-chrome-launcher":"^0.1.5","karma-firefox-launcher":"^0.1.3","karma-mocha":"^0.1.7","mocha":"^1.21.4"},"scripts":{"test":"./node_modules/karma/bin/karma start"},"license":"MIT","gitHead":"bc1e95ac9e2957c4d8d922760fb3bfb22c16a86d","bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"homepage":"https://github.com/RadLikeWhoa/Countable","_id":"countable@2.1.1","_shasum":"6d1f0cc4581ea9c58a306d4867dea26130076ba4","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.9","_npmUser":{"name":"sachaschmid","email":"schmid.sacha@gmail.com"},"maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"dist":{"shasum":"6d1f0cc4581ea9c58a306d4867dea26130076ba4","tarball":"https://registry.npmjs.org/countable/-/countable-2.1.1.tgz","integrity":"sha512-nR91n5+yTaSfYdUhvDTNoY5DdK9nILXHPj2bO94xyKFn7RoGgKO/pw2e4gBv1QgLI4KwohrDKRCx6ERLMKZfNQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEchBDDFNj5pZs1Dl/pPtPRMr1QL2zB/YNxt4Yk7VYkdAiBy8Z4gQBjY1aMLxLxdHgzT9uuWJfN6fpxcq2UqGX0mEw=="}]},"directories":{}},"3.0.0":{"name":"countable","description":"Countable is a JavaScript library to add live paragraph-, word- and character-counting to an HTML element.","author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"version":"3.0.0","main":"Countable.js","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"git+https://github.com/RadLikeWhoa/Countable.git"},"devDependencies":{"chai":"^4.0.2","karma":"^1.7.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.0.1","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0","mocha":"^3.4.2"},"scripts":{"test":"./node_modules/karma/bin/karma start"},"license":"MIT","gitHead":"e3884ac1c11789f70fcec3a20ec11ca92dc6942f","bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"homepage":"https://github.com/RadLikeWhoa/Countable#readme","_id":"countable@3.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"sachaschmid","email":"schmid.sacha@gmail.com"},"dist":{"integrity":"sha512-4yvrd8I79ZVjUdtyxppZGmNkj/jVJA0dAkpiV+m18eWVEjcu+s9ghBLLUjnVhTdONuyJ+5q0n/3G2U3m4YCkIA==","shasum":"c86775f135199e01f459aa58dab0c4d5f4ae4b51","tarball":"https://registry.npmjs.org/countable/-/countable-3.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMBcEvZ+xxAMa7LGhqxr6R50bHEAlIUi5YaDj47arsDAIgJPq9svXuJRKIcywunKPVD1dhVZTChuz2xZFlI679x40="}]},"maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/countable-3.0.0.tgz_1499946436718_0.4634613988455385"},"directories":{}},"3.0.1":{"name":"countable","description":"Countable is a JavaScript library to add live paragraph-, word- and character-counting to an HTML element.","author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"version":"3.0.1","main":"Countable.js","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"git+https://github.com/RadLikeWhoa/Countable.git"},"devDependencies":{"chai":"^4.0.2","karma":"^1.7.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.0.1","karma-mocha":"^1.3.0","karma-safari-launcher":"^1.0.0","mocha":"^3.4.2","uglify-es":"^3.3.9"},"scripts":{"test":"./node_modules/karma/bin/karma start","minify":"./node_modules/uglify-es/bin/uglifyjs -c -m -o Countable.min.js Countable.js"},"license":"MIT","gitHead":"4d2812d7b53736d2bca4268b783997545d261c43","bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"homepage":"https://github.com/RadLikeWhoa/Countable#readme","_id":"countable@3.0.1","_npmVersion":"6.3.0","_nodeVersion":"9.3.0","_npmUser":{"name":"sachaschmid","email":"schmid.sacha@gmail.com"},"dist":{"integrity":"sha512-dz/sdi+RFpHJKMen5RAB9EKpCKd/q5WMfxG3SbdbQ3Pak4+SEPmDhVWZF0GTTHwjqjR+7DmiZHzZiFJ4qeAzmg==","shasum":"1d0c1c426e8db08890534151ac7448c3642496ce","tarball":"https://registry.npmjs.org/countable/-/countable-3.0.1.tgz","fileCount":11,"unpackedSize":96655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbbEYUCRA9TVsSAnZWagAAqswP/3VrWfsNyHncSe4nyilE\nE3Mw4897NwY9y6PGtdmvdMDxs/54QwtiEZHut37Aq2IAmIDIugS/iEzL2+S/\nwxfRtjL6BK8pcis6J3rQA8rt4c7PFQMsrAYLHxboCCyohULb0rMMgpSt6/Uw\nB5m2zxdp9zr5Wx1Z/Tt1R8wOdb5QTAF7szk2rSsVfgYhhPN0HAfMXCBksBOv\n3U0J6dooeeuuHp7WezKXBHf9RkADAJSplo72Iw3xcblkNvsRUXQSzHvnCwSl\ni9/3LAv04FowyKfuVgpzRptvOV1TPwEJVdobgcK9WJn8rpKti8WFXID8kW7w\n3jWVS4oTyrRRDdQvMfyffWCatKGeDqSweAekj7LRhy96zuO9Gi9defBaDn/W\n7hith4MZApF3h9YqhJR2YlnmfP7R89g/E1Gip3XGklJMQ8zDFA0/7XvXF44m\ndZMDWal7Si9npalvyvfT+Vlu7/SLOioSRKi5PSw93lSZKyVTap7nDotwS1Mr\n6tMIFM28Hd+vJ6yHNeiB0kQLPxJ2VCP5KLKmPWhPE+5UzrT0eZ+xQgVczU5Z\n+xzhEMkPSm3NT4YbeU8DbjpS7pIXv4apwc5+NNKVoWDgDTulIYUTxX7Tqn7Y\nn0zWUdLZQZ0QRxRVO1plT9WlLBBrmgmGg0Ep846r6uKOUmFsjRyuzwgJgG8D\nC/AQ\r\n=WulR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAv35lSEnV833C9BGzVq/B5aviD0bzi2JxOgKSF9dFcGAiEAmprRqYk7TeGbltv6uBFiaE7VXshnbmdGhG/Lvjri254="}]},"maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/countable_3.0.1_1533822483919_0.892178953808233"},"_hasShrinkwrap":false}},"readme":"# Countable\n\n[![Build Status](http://img.shields.io/travis/RadLikeWhoa/Countable.svg)](https://travis-ci.org/RadLikeWhoa/Countable)\n[![Code Climate](https://codeclimate.com/github/RadLikeWhoa/Countable/badges/gpa.svg)](https://codeclimate.com/github/RadLikeWhoa/Countable)\n[![Latest Tag](http://img.shields.io/github/tag/RadLikeWhoa/Countable.svg)](https://github.com/RadLikeWhoa/Countable/tags)\n[![License](http://img.shields.io/badge/license-MIT-orange.svg)](https://github.com/RadLikeWhoa/Countable/blob/master/LICENSE.md)\n\nCountable is a JavaScript function to add **live paragraph-, word- and character-counting** to an HTML element. Countable is a *zero-dependency* library and comes in at **1KB** when minified and gzipped.\n\n[**View the Demo**](http://radlikewhoa.github.io/Countable#demo)\n\n## Installation\n\nThe preferred method of installation is [**npm**](https://www.npmjs.com/) or [**yarn**](https://yarnpkg.com/).\n\n```\nnpm i --save-dev countable\nyarn add --dev countable\n```\n\nAlternatively, you can download the latest [zipball](https://github.com/RadLikeWhoa/Countable/archive/master.zip) or copy the [script](https://raw.github.com/RadLikeWhoa/Countable/master/Countable.js) directly.\n\n## Usage\n\nCountable is available as a Node / CommonJS module, an AMD module and as a global. All methods are accessed on the Countable object directly.\n\n### Callbacks\n\nThe `on` and `count` methods both accept a callback. The given callback is then called whenever needed with a single parameter that carries all the relevant data. `this` is bound to the current element. Take the following code for an example.\n\n```javascript\nCountable.count(document.getElementById('text'), counter => console.log(this, counter))\n```\n\n```\n=> <textarea id=\"text\"></textarea>, { all: 0, characters: 0, paragraphs: 0, words: 0 }\n```\n\nProperty   | Meaning\n---------- | --------------------------------------------------------------------------------------------\nparagraphs | The number of paragraphs. Paragraphs can be separated by either a soft or a hard (two line breaks) return. To use hard returns, set the corresponding option (`hardReturns`).\nsentences  | The number of sentences. Sentences are separated by a sentence-terminating character.\nwords      | The number of words. Words are split using spaces.\ncharacters | The number of characters (without spaces). This contains all non-whitespace characters.\nall        | The number of characters including whitespace. This is the total number of all characters in the element.\n\n### Countable.on(elements, callback, options)\n\nBind the callback to all given elements. The callback gets called every time the element's value or text is changed.\n\n```javascript\nCountable.on(area, counter => console.log(counter))\n```\n\n### Countable.off(elements)\n\nRemove the bound callback from all given elements.\n\n```javascript\nCountable.off(area)\n```\n\n### Countable.count(elements, callback, options)\n\nSimilar to `Countable.on()`, but the callback is only executed once, there are no events bound.\n\n```javascript\nCountable.once(area, counter => console.log(counter))\n```\n\n### Countable.enabled(elements)\n\nChecks the live-counting functionality is bound to the given.\n\n```javascript\nCountable.enabled(area)\n```\n\n### Options\n\n`Countable.on()` and `Countable.count()` both accept a third argument, an options object that allows you to change how Countable treats certain aspects of your element's text.\n\n```javascript\n{\n  hardReturns: false,\n  stripTags: false,\n  ignore: []\n}\n```\n\nBy default, paragraphs are split by a single return (a soft return). By setting `hardReturns` to true, Countable splits paragraphs after two returns.\n\nDepending on your application and audience, you might need to strip HTML tags from the text before counting it. You can do this by setting `stripTags` to true.\n\nSometimes it is desirable to ignore certain characters. These can be included in an array and passed using the `ignore` option.\n\n## Browser Support\n\nCountable supports all modern browsers. Full ES5 support is expected, as are some ES6 features, namely `let` and `const`.\n","maintainers":[{"name":"sachaschmid","email":"schmid.sacha@gmail.com"}],"time":{"modified":"2022-06-14T01:54:25.175Z","created":"2014-08-17T15:17:33.657Z","2.0.2":"2014-08-17T15:17:33.657Z","2.1.0":"2014-11-06T10:51:49.977Z","2.1.1":"2015-05-01T20:06:13.146Z","3.0.0":"2017-07-13T11:47:17.721Z","3.0.1":"2018-08-09T13:48:03.987Z"},"homepage":"https://github.com/RadLikeWhoa/Countable#readme","keywords":["paragraphs","words","characters","count","live"],"repository":{"type":"git","url":"git+https://github.com/RadLikeWhoa/Countable.git"},"author":{"name":"Sacha Schmid","email":"https://twitter.com/sachaschmid"},"bugs":{"url":"https://github.com/RadLikeWhoa/Countable/issues"},"license":"MIT","readmeFilename":"README.md","users":{"ux_web":true,"filipve":true,"goatandsheep":true}}