{ "name": "downsize", "version": "0.0.8", "description": "Tag-safe truncation for HTML and XML. Works by word!", "main": "index.js", "scripts": { "test": "mocha -R spec test.js" }, "repository": { "type": "git", "url": "git://github.com/cgiffard/Downsize.git" }, "keywords": [ "text", "truncate", "downsize", "word", "limit", "character", "html", "xml", "tag", "safe" ], "author": { "name": "Christopher Giffard" }, "license": "BSD", "dependencies": { "xregexp": "2.0.0" }, "devDependencies": { "chai": "~1.5.0", "mocha": "~1.9.0" }, "readmeFilename": "README.md", "bugs": { "url": "https://github.com/cgiffard/Downsize/issues" }, "readme": "# Downsize\n\nTag-safe HTML and XML text-truncation!\n\n```sh\nnpm install downsize\n```\n\n## Usage\n\n### Word-truncation\n\n```javascript\ndownsize(\"
some markup here...
\",{\"words\": 2});\n```\n\n```html\nsome markup
\n```\n\n### Character truncation\n\n```javascript\ndownsize(\"some markup here...
\",{\"characters\": 6});\n```\n\n```html\nsome m
\n```\n\n### Appending an ellipsis\n\n```javascript\ndownsize(\"some markup here...
\",{\"characters\": 6, \"append\": \"...\"});\n```\n\n```html\nsome m...
\n```\n\n### Rounding to the end of the paragraph\n\n```javascript\ndownsize(\"Why, hello there!
Hello again!
\",{\"characters\": 6, round:true});\n```\n\n```html\nWhy, hello there!
\n```\n\n## Notes\n\nDownsize is designed to handle bad markup, and should count words and \ncharacters accurately in spite of it. But it won't hold your hand.\n\nIt does close outstanding open tags for you, but leaves erroneous close-tags \nfor which the opening tag couldn't be found or was erroneously nested.\n\n## Testing\n\n```sh\nnpm test\n```\n\n## Maintainers\n\n* [Christopher Giffard]([http://github.com/cgiffard)\n* [Adam Zethraeus]([http://github.com/zethraeus)\n\n[Thanks also to all the contributors!](https://github.com/cgiffard/Downsize/graphs/contributors)", "homepage": "https://github.com/cgiffard/Downsize#readme", "_id": "downsize@0.0.8", "_shasum": "21435a610c8c68220f5cc31474979b4d025f038e", "_resolved": "https://registry.npmjs.org/downsize/-/downsize-0.0.8.tgz", "_from": "https://registry.npmjs.org/downsize/-/downsize-0.0.8.tgz" }