{"name":"escape-latex","version":"1.0.3","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-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":"fc0ead6b1aa210cc5556d118ab50c7e4005c2425","bugs":{"url":"https://github.com/dangmai/escape-latex/issues"},"homepage":"https://github.com/dangmai/escape-latex#readme","_id":"escape-latex@1.0.3","_npmVersion":"5.5.1","_nodeVersion":"8.9.2","_npmUser":{"name":"dangmai","email":"contact@dangmai.net"},"dist":{"integrity":"sha512-GfKaG/7FOKdIdciylIzgaShBTPjdGQ5LJ2EcKLKXPLpcMO1MvCEVotkhydEShwCINRacZr2r3fk5A1PwZ4e5sA==","shasum":"1b9085e3e66570faabe21f05655643f64e78717a","tarball":"http://registry-npm.ywwl.com/escape-latex/download/escape-latex-1.0.3.tgz","fileCount":4,"unpackedSize":7126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa64ASCRA9TVsSAnZWagAAYJYP+gMnBzws2P1PVGJEUzHR\nJMwIo3SQShoPmmV0ZPP0FNxLtvdr4wbRdCVplcPBDCIeZQKANRMjvajXUS8B\n2pPIFhSzUF0w5G//FdJ9xdSrbjphRRqZFS/ht6vyFGTqjs0dYKD2FhQnQEZw\nB8bqP/Ltyvxzw6sZ2XP4mx+OEPRkbLNtGo5nNkTwGZmKtAp0Bj6eweTLYZkU\n4lFzs2YgpqO9aa/0EBCXlYqLdo58ACcFOiQahOZxy0UWKVT+fZj0Ff4O0XPY\nTW7J/W+nbeXM9fhYh10xwSwiWxfHSHIG129AClMbWZNQ5F1Jj9YxQ/XVTYV8\nPSOKlTjskdIt+34EriNKo8xcgDdlgscDcBqKwoWaPfCgfqPqRp42CSYHRBl9\nT9WiQjOyB9SovIIymxhRUOQ7fBwUVUVdssBT2s4gJR/R1qmVpSdkDVEeWOpp\n3frMYjmxw4AMzmk/9l3bd1toQMpcLVKPZmj6VZmcqd9wqlLkC0Btu8mQ4zZc\nd+ZL10/XHvHKU49Ce5RnwLQwyY9Vs+19na88dcf8qa4MNWRzn2rCrKwmpYHx\npn+QT0Db8oJUDq3nzfLJG5O8HmMh0dL/l3/aI2V+pJRdGUCsjAZFEVRTmfVw\n0Ix/ypfsqW5nwkjsUeu8Nz4yB5lf9PTb/lrRGlMWfnaHXKiva1QJTIH3q6Nw\ndx5A\r\n=mPUu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/uyeQRJ4Vr/w4TM4GtVr9ngVo78Ni7fStSfVk3emangIgfSmljO/5/zJNkiXGVtPRHWgZSyUG1ShI25OtW233E9M="}],"size":3236,"noattachment":false,"key":"/escape-latex/-/escape-latex-1.0.3.tgz"},"maintainers":[{"name":"dangmai","email":"contact@dangmai.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-latex_1.0.3_1525383185444_0.9026072678012629"},"_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":1525383185534,"_cnpm_publish_time":1525383185534,"dist-tags":{"latest":"1.2.0","next":"1.0.0-beta.3"}}