{"name":"escape-latex","version":"1.1.0","description":"Escape LaTeX special characters with Javascript","main":"./dist/index.js","files":["dist"],"scripts":{"test":"mocha --require babel-core/register -u tdd ./src/**/*.test.js","preversion":"npm test && npm run build","postversion":"git push && git push --tags","precommit":"npm run lint && lint-staged","prettier":"prettier --write ./src/**/*.js","lint":"eslint ./src","init":"mkdir dist","clean":"rm -rf dist","prebuild":"npm run clean && npm run init","build":"babel ./src -d ./dist --ignore index.test.js"},"lint-staged":{"*.{js,json,css,md}":["npm run prettier","git add"]},"eslintConfig":{"parserOptions":{"ecmaVersion":8},"extends":["eslint:recommended","google","prettier"],"env":{"node":"true"}},"prettier":{"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/dangmai/escape-latex.git"},"keywords":["latex","escape"],"devDependencies":{"babel-cli":"^6.26.0","babel-core":"^6.26.0","babel-plugin-transform-object-assign":"^6.22.0","babel-preset-env":"^1.6.1","chai":"^4.1.2","eslint":"^4.15.0","eslint-config-google":"^0.9.1","eslint-config-prettier":"^2.9.0","husky":"^0.14.3","lint-staged":"^7.0.5","mocha":"^5.0.0","prettier":"^1.9.2"},"author":{"name":"Dang Mai"},"license":"MIT","gitHead":"09c3c70f87708335aba29839704bd9bbf91f8373","bugs":{"url":"https://github.com/dangmai/escape-latex/issues"},"homepage":"https://github.com/dangmai/escape-latex#readme","_id":"escape-latex@1.1.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"dangmai","email":"contact@dangmai.net"},"dist":{"integrity":"sha512-7k372jNDrL8uW7P/Sw8IkF+QcaeGoyjzrLx4pJj/CSIe02CvxL1wUJ+qMVVHsna/jNZ6PD6aCo7iEeRnXTzvdw==","shasum":"c0a94a51eb8c73c3a67a95cc90fbb626cef54539","tarball":"http://registry-npm.ywwl.com/escape-latex/download/escape-latex-1.1.0.tgz","fileCount":4,"unpackedSize":7473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbFaX+CRA9TVsSAnZWagAAxIQQAJiJ/1NYJCVY5+dSQ/Cp\n131rkzOfN6E+YcAeCHiPYjT554N/YNIBDjv6sLqCL074JVcifQbmmgTaqFyP\n3KaskRC2nQAf+qft0ocnqJBvP5oJ9cCraetd6THBT+WjcpZAQehZ2iq7fugv\n6A3u8CkEJ+ko8djxWiz54xsX/62uINVitWPHJCTPGN++NDVnufSduOYS7PdY\nknZKzyB/JADrWNb4cNzTxeCyf9vasfOdWNuRFRJbrf3HuZZId/k7MxxojSy5\nfa3xer2T7Dla1nkrSpgoDmaNYpPSS3vO7LNZfo1QV805vKokN2kDD/i3q4+f\nfHwTKYHt6sT8ouCMy5FVdi0BbTi1UsgNZ7KsomrjWkpHPNIAS8Mp5uPGTroZ\nKvPPvTA7xL22r8Dx5gR6bA1KPOcglxLNjl7oTMczs7Jt2Niwholn9b55Pjm8\n/cMQr7jywhLguvDujJTJ1/W2/u5jVVsFr1f7wG/MvaFytpa65Dsm5zazi2cB\nFcaqBsx2TsdzkAFbLpOlzRxJAj5oMsDApNwi09HNLWCCdfkKrAMOpWk81gkn\nRP4DJRxSckNUfmLSYaUpNr9w0M6GJrnskjpwP/4jjO6IcQc+7kmylbQp4DnB\n648pGuOvrNJHdCBaa1snC+VUj5+urzXd+YsmtR8mhCH6379/rl/yyBUuL6DE\nyeDR\r\n=C+uz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbsiALHMDA36eW0sVBGfr3XdEql0cI/Wj7HNccZFK08AiEA3YlzUoKxjWvY6bE7qZxH7q3ZKi0nLnMfzdeu2fjbSY4="}],"size":3395,"noattachment":false,"key":"/escape-latex/-/escape-latex-1.1.0.tgz"},"maintainers":[{"name":"dangmai","email":"contact@dangmai.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-latex_1.1.0_1528145404458_0.7708611872994364"},"_hasShrinkwrap":false,"readme":"# escape-latex\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/dangmai/escape-latex.svg)](https://greenkeeper.io/)\n\n[![Build Status](https://travis-ci.org/dangmai/escape-latex.png)](https://travis-ci.org/dangmai/escape-latex)\n\nEscape LaTeX special characters with Javascript in NodeJS (>= 4.x) environment.\n\n## Usage\n\n```javascript\nnpm install escape-latex\nvar lescape = require('escape-latex');\nlescape(\"String to be escaped here #yolo\");\n```\n\n## API\n\n```javascript\nlescape((input: String), {\n  preserveFormatting: Boolean,\n  escapeMapFn: Function,\n});\n```\n\nBy default,\n`escape-latex` only escapes characters that would result in malformed LaTeX.\nThese characters include `# $ % & \\ ^ _ { }`.\n\nThis means that the final LaTeX output might not look the same as your input Javascript string.\nFor example, multiple spaces are kept as-is, which may be truncated to 1 space by your LaTeX software.\n\nIf you want the final output string to be as similar to your input Javascript string as possible,\nyou can set the `preserveFormatting` param to `true`, like so:\n\n```javascript\nlescape(\"Hello   World\", { preserveFormatting: true });\n// Hello~~~World\n```\n\nWhich will be converted to three non-breaking spaces by your LaTeX software.\n\nThe list of format characters that are escaped include `space, \\t (tab), – (en-dash), — (em-dash)`.\n\nThere is also the param `escapeMapFn` to modify the mapping of escaped characters,\nso you can add/modify/remove your own escapes if necessary.\n\nIt accepts a callback function that takes in the default character escapes and the formatting escapes as parameters, and returns a complete escape mapping. Here's an example:\n\n```javascript\nlescape(\"Hello   World\", {\n  preseveFormatting: true,\n  escapeMapFn: function(defaultEscapes, formattingEscapes) {\n    formattingEscapes[\" \"] = \"\\\\\\\\\";\n    return Object.assign({}, defaultEscapes, formattingEscapes);\n  },\n});\n// Hello\\\\\\\\\\\\world\n```\n\n## Testing\n\n```\nnpm test\n```\n\n## Notes\n\n* If you are updating from `escape-latex < 1.0.0`,\n  the `en-dash` and `em-dash` are no longer escaped by default.\n  Please use `preserveFormatting` to turn them on if necessary.\n\n## License\n\nMIT\n","publish_time":1528145404856,"_cnpm_publish_time":1528145404856,"dist-tags":{"latest":"1.2.0","next":"1.0.0-beta.3"}}