{ "manifest": { "name": "eol", "description": "Newline character converter", "version": "0.9.1", "homepage": "https://github.com/ryanve/eol", "license": "MIT", "author": { "name": "Ryan Van Etten" }, "main": "eol.js", "types": "eol.d.ts", "typings": "eol.d.ts", "scripts": { "lint": "eslint . --ext .js", "preversion": "npm test", "pretest": "npm run lint", "test": "node test.js" }, "repository": { "type": "git", "url": "https://github.com/ryanve/eol.git" }, "bugs": { "url": "https://github.com/ryanve/eol/issues" }, "keywords": [ "eol", "lf", "cr", "crlf", "newline", "newlines", "convert", "converter", "conversion", "character", "formatting", "format", "string", "javascript", "typescript", "ender", "file" ], "devDependencies": { "aok": "^1.9.0", "eslint": "^3.15.0" }, "_registry": "npm", "_loc": "/home/josie/.cache/yarn/v6/npm-eol-0.9.1-integrity/node_modules/eol/package.json", "readmeFilename": "README.md", "readme": "# eol\n[Newline](http://en.wikipedia.org/wiki/Newline) character converter for JavaScript. Available [on npm](https://www.npmjs.com/package/eol).\n\n```\nnpm install eol --save\n```\n\n### `require` or `import`\n\n```js\nconst eol = require('eol')\n```\n\n```js\nimport eol from 'eol'\n```\n\n## API\n\n### `eol.auto(text)`\n- Normalize line endings in text for the current operating system\n- @return string with line endings normalized to `\\r\\n` or `\\n`\n\n### `eol.crlf(text)`\n- Normalize line endings in text to CRLF (Windows, DOS)\n- @return string with line endings normalized to `\\r\\n`\n\n### `eol.lf(text)`\n- Normalize line endings in text to LF (Unix, OS X)\n- @return string with line endings normalized to `\\n`\n\n### `eol.cr(text)`\n- Normalize line endings in text to CR (Mac OS)\n- @return string with line endings normalized to `\\r`\n\n### `eol.before(text)`\n- Add linebreak before text\n- @return string with linebreak added before text\n\n### `eol.after(text)`\n- Add linebreak after text\n- @return string with linebreak added after text\n\n### `eol.split(text)`\n- Split text by newline\n- @return array of lines\n\n### Joining\n\nCoercing `eol.auto`|`eol.crlf`|`eol.lf`|`eol.cr` to string yields the appropriate character. This is useful for joining.\n\n```js\nString(eol.lf) // \"\\n\"\neol.split(text).join(eol.auto) // same as eol.auto(text)\neol.split(text).filter(line => line).join(eol.auto) // text joined after removing empty lines\neol.split(text).slice(-3).join(eol.auto) // last 3 lines joined\n```\n\n## License\nMIT\n", "licenseText": "MIT License\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n" }, "artifacts": [], "remote": { "resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", "type": "tarball", "reference": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz", "hash": "", "integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==", "registry": "npm", "packageName": "eol", "cacheIntegrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg== sha1-9wGRL1BAdL41xhF6XEreSc1Ues0=" }, "registry": "npm", "hash": "0ecfd3128663c20811a33fd0d8eed21378b8266eba9aa4c37e674776affb0ca564ddbae8f50f21e9675729d3ea14b328ab1ac32b94954731d53ce4babae1adae" }