{"_id":"loophole","_rev":"26-23814ab3980e5b7c241d9ac01dbc91bd","name":"loophole","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"loophole","version":"0.1.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"licenses":[{"type":"MIT","url":"http://github.com/atom/loophole/raw/master/LICENSE.md"}],"devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"homepage":"https://github.com/atom/loophole","_id":"loophole@0.1.0","dist":{"shasum":"8feb2fd053d650e9c850df11ef1f6242c5bda95c","tarball":"https://registry.npmjs.org/loophole/-/loophole-0.1.0.tgz","integrity":"sha512-IOfie4an5gNbOI+9q/tN4M3jS38jog1+yDhVc0HyB1bTrbryfIV8uS8h8TrFbAyJ1gteuDZ34Fk+mFl90nOO+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGFhUSYicUeypJhPUeuSkDX6iuAnjvlYd55c7u2kcMnxAiATgzgMD3c805rrVj/As9st4az7qEWsIQ2vzpGcP77MaQ=="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"nathansobo","email":"nathansobo@gmail.com"},"maintainers":[{"name":"nathansobo","email":"nathansobo@gmail.com"}]},"0.2.0":{"name":"loophole","version":"0.2.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"licenses":[{"type":"MIT","url":"http://github.com/atom/loophole/raw/master/LICENSE.md"}],"devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"homepage":"https://github.com/atom/loophole","_id":"loophole@0.2.0","dist":{"shasum":"25a78b8e8bb7300ce8c459aaa218834c7fd793c4","tarball":"https://registry.npmjs.org/loophole/-/loophole-0.2.0.tgz","integrity":"sha512-dEgK6DPK9knhN9sTab1RMdgbMFSugpJRlVhUCoHzivRx3Af8QkFPfQo6z13c/3uPMq3oLl8vltz0STUnuMMkQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLvCm95BVi6k9SQIMl85L6PpE+1CnCfp16DV7vIhsJVAIgUPwx0fHwh2365NBwhKuPZH9wRsTeXH3bpGaRkzZWAHs="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"nathansobo","email":"nathansobo@gmail.com"},"maintainers":[{"name":"nathansobo","email":"nathansobo@gmail.com"}]},"0.3.0":{"name":"loophole","version":"0.3.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"licenses":[{"type":"MIT","url":"http://github.com/atom/loophole/raw/master/LICENSE.md"}],"devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"homepage":"https://github.com/atom/loophole","_id":"loophole@0.3.0","dist":{"shasum":"0b4513779300e5993d49c6daa2f98dc5eb3d6b20","tarball":"https://registry.npmjs.org/loophole/-/loophole-0.3.0.tgz","integrity":"sha512-uG/wxjeOv6acvnqwrk57YCXvZX6j81kR822BjxDzPljMYlA9SvL5oyVxxSc1QoCnTE5wDz6Tb7+fDqfUXqIRSw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClz7qA2TZTN9cFaI78mwPtuFdktYmWxnvEmdQZKsIS6wIgUZKgc1uO2xGkGgZjBMmDhXwwHAWYBDI2itP6lMC9cqU="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"nathansobo","email":"nathansobo@gmail.com"},"maintainers":[{"name":"nathansobo","email":"nathansobo@gmail.com"}]},"0.4.0":{"name":"loophole","version":"0.4.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"licenses":[{"type":"MIT","url":"http://github.com/atom/loophole/raw/master/LICENSE.md"}],"devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"homepage":"https://github.com/atom/loophole","_id":"loophole@0.4.0","dist":{"shasum":"f10b1fa902e0091577fdb87b58688988f43a4e15","tarball":"https://registry.npmjs.org/loophole/-/loophole-0.4.0.tgz","integrity":"sha512-QaTrGwrk7VgtXTdUa4AbTUEMJ5NcWvY+91zrVhLrKvsknc+aOiPx5YrUeqpdiyetjRimUeIn0ab1YkIVsxCd+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjd+UTBQ1/F8N3k8Pf6WbQVs14oj7+w6qaE7LcmR4MAwIhAJXBLHnt0LeqmTN6kW0GqncU2MN230wmIQ/mZGsQbILo"}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"nathansobo","email":"nathansobo@gmail.com"},"maintainers":[{"name":"nathansobo","email":"nathansobo@gmail.com"}]},"1.0.0":{"name":"loophole","version":"1.0.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"licenses":[{"type":"MIT","url":"http://github.com/atom/loophole/raw/master/LICENSE.md"}],"devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"homepage":"https://github.com/atom/loophole","_id":"loophole@1.0.0","dist":{"shasum":"27d892490e5e875a0d47917c408af650bf4d0bf0","tarball":"https://registry.npmjs.org/loophole/-/loophole-1.0.0.tgz","integrity":"sha512-RYryb3m/DZZ7QW4hoOSgoy4H+3W/9Mmetq3wMwvN/9u2rRoWWsjxjvhkrIeraBaHV8WyxjAM9Wq2NN8WTg8/nw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClL3S1CjauTHWyaBQ1C8MWb2Wzbj4VwZANuQ255hMz5AIgPXaX8hxj4jZaZyyAqlcC+945bTu/zIpQgAJ0TOlJSOc="}]},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"nathansobo","email":"nathansobo@gmail.com"},"maintainers":[{"name":"nathansobo","email":"nathansobo@gmail.com"}]},"1.1.0":{"name":"loophole","version":"1.1.0","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom","main":"./lib/loophole.js","scripts":{"prepublish":"grunt clean lint coffee","test":"grunt test"},"repository":{"type":"git","url":"git+https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"license":"MIT","devDependencies":{"coffee-script":"~1.7.0","jasmine-focused":"1.x","grunt-contrib-coffee":"~0.9.0","grunt-cli":"~0.1.8","grunt":"~0.4.1","grunt-shell":"~0.2.2","grunt-coffeelint":"0.0.6","rimraf":"~2.2.2","temp":"~0.6.0"},"gitHead":"6afebe160a233420dbca591bd5081b12c47cdb15","homepage":"https://github.com/atom/loophole#readme","_id":"loophole@1.1.0","_shasum":"37949fea453b6256acc725c320ce0c5a7f70a2bd","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"nathansobo","email":"nathan@github.com"},"maintainers":[{"name":"nathansobo","email":"nathan@github.com"},{"name":"kevinsawicki","email":"kevinsawicki@gmail.com"},{"name":"benogle","email":"ogle.ben@gmail.com"},{"name":"maxbrunsfeld","email":"maxbrunsfeld@gmail.com"},{"name":"thedaniel","email":"danielwh@gmail.com"}],"dist":{"shasum":"37949fea453b6256acc725c320ce0c5a7f70a2bd","tarball":"https://registry.npmjs.org/loophole/-/loophole-1.1.0.tgz","integrity":"sha512-zgLykD4MuL9HJRsoeKuGRXz4L9t1C0oDZPjFeUg5MLQyZjxWdxIbPHgRijVGN98DieVWJuo2fi9nEUDcdDbEiQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQWbSOlXLQg3Y8Q/M4s3F8LNhXIk/JVNZgDP0BO60qLwIgMj/39W4RaqcDG2Yy3iWPhlPJexVpYl3juWBc1bUA3iY="}]}}},"readme":"# Eval Loophole [![Build Status](https://travis-ci.org/atom/loophole.svg?branch=master)](https://travis-ci.org/atom/loophole)\n\nThis is a hack to enable third-party libraries that depend on a limited subset\nof `eval` semantics to work in Atom with a content security policy that forbids\ncalls to `eval`.\n\n```coffee\n{allowUnsafeEval, allowUnsafeNewFunction} = require 'loophole'\n\nallowUnsafeEval ->\n  crazyLibrary.exploitLoophole() # allows `eval(...)`\n\nallowUnsafeNewFunction ->\n  crazyLibrary.exploitLoophole() # allows `new Function(...)`\n```\n\nYou can also use the exported `Function` constructor directly:\n\n```coffee\n{Function} = require 'loophole'\nf = new Function(\"return 1 + 1;\")\n```\n\n## How?\n\n`allowUnsafeEval` replaces `eval` with a call to `vm.runInThisContext`, which\nwon't perfectly emulate `eval` but is good enough in certain circumstances, like\ncompiling [PEG.js][peg-js] grammars.\n\n`allowUnsafeNewFunction` temporarily replaces `global.Function` with\n`loophole.Function`, which passes the source of the desired function to\n`vm.runInThisContext`.\n\n## Why?\n\nIf there's a loophole, why even enable CSP? It still prevents developers from\naccidentally invoking eval with legacy libraries. For example, did you know that\njQuery runs eval when you pass it content with script tags? If you want eval,\nyou'll need to explicitly ask for it.\n\n[peg-js]: http://pegjs.majda.cz/\n","maintainers":[{"email":"atom@github.com","name":"atom-team"},{"email":"danielwh@gmail.com","name":"thedaniel"},{"email":"maxbrunsfeld@gmail.com","name":"maxbrunsfeld"},{"email":"ogle.ben@gmail.com","name":"benogle"},{"email":"kevinsawicki@gmail.com","name":"kevinsawicki"},{"email":"nathan@github.com","name":"nathansobo"}],"time":{"modified":"2022-06-19T14:17:46.419Z","created":"2014-03-07T01:54:40.622Z","0.1.0":"2014-03-07T01:54:40.622Z","0.2.0":"2014-03-07T23:59:26.441Z","0.3.0":"2014-03-08T00:12:51.228Z","0.4.0":"2014-03-11T19:33:30.062Z","1.0.0":"2014-03-11T20:28:40.483Z","1.1.0":"2015-07-29T16:13:42.265Z"},"homepage":"https://github.com/atom/loophole#readme","repository":{"type":"git","url":"git+https://github.com/atom/loophole.git"},"bugs":{"url":"https://github.com/atom/loophole/issues"},"readmeFilename":"README.md","users":{"knownasilya":true},"license":"MIT"}