{"_id":"@18f/private-eye","_rev":"57-59b6a1ac5953385600e11a7b142b6255","name":"@18f/private-eye","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"@18f/private-eye","version":"1.0.0","keywords":["private","link","browser","href"],"author":{"name":"Aidan Feldman","email":"aidan.feldman@gsa.gov"},"license":"CC0-1.0","_id":"@18f/private-eye@1.0.0","maintainers":[{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"}],"homepage":"https://github.com/18F/private-eye#readme","bugs":{"url":"https://github.com/18F/private-eye/issues"},"dist":{"shasum":"52552f3a66a2ef7613abb2808dc2038a4b77ff4c","tarball":"https://registry.npmjs.org/@18f/private-eye/-/private-eye-1.0.0.tgz","integrity":"sha512-yWpNxVFkRpGNBJqJV1uR49V2Cllh9YFJfn6GxvqUO/xsIJ9X/h76De8PIMORJqCGpyVeXJweTPdMnCD6SRchWA==","signatures":[{"sig":"MEUCIDxvK/11ISya9VlhN7sgPJMQGWxLiSnR9r4z+fXClxuoAiEAu5bJAIVuhGa19/HS47qJdRxJ+mjuRkl7RURHlaQcPeg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"private-eye.js","_from":".","_shasum":"52552f3a66a2ef7613abb2808dc2038a4b77ff4c","gitHead":"64bb0e15af3e80228e4103314e455da6cc9b14e4","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"},"repository":{"url":"git+https://github.com/18F/private-eye.git","type":"git"},"_npmVersion":"3.3.12","description":"A JavaScript plugin to warn users about links to private pages.","directories":{},"_nodeVersion":"5.4.0"},"1.1.0":{"name":"@18f/private-eye","version":"1.1.0","keywords":["private","link","browser","href"],"author":{"name":"Aidan Feldman","email":"aidan.feldman@gsa.gov"},"license":"CC0-1.0","_id":"@18f/private-eye@1.1.0","maintainers":[{"name":"18f-devops","email":"devops@gsa.gov"},{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"},{"name":"jbarnicle","email":"michael.barnicle@gsa.gov"},{"name":"jeremiak","email":"jbkimelman@gmail.com"},{"name":"jmcarp","email":"jm.carp@gmail.com"},{"name":"mbland","email":"mbland@acm.org"},{"name":"mgwalker","email":"npm@darkcooger.net"},{"name":"msecret","email":"msegreto@miceover.com"},{"name":"noahmanger","email":"noah.manger@gmail.com"},{"name":"rogeruiz","email":"hi@rog.gr"},{"name":"shawnbot","email":"shawnbot-npm@nym.hush.com"},{"name":"stvnrlly","email":"stvnrlly@stvnrlly.com"}],"homepage":"https://github.com/18F/private-eye#readme","bugs":{"url":"https://github.com/18F/private-eye/issues"},"dist":{"shasum":"dd0605eefd996c04e6f6954cb243e1a576e71ee0","tarball":"https://registry.npmjs.org/@18f/private-eye/-/private-eye-1.1.0.tgz","integrity":"sha512-tXvXPlL8balQiX8W6DtCynxg1kYhRUDZFOAOwOEByMK7oIaoCZhlqPSCkF63dD8FIlNAMLG4xJw+tQ+szZdfIg==","signatures":[{"sig":"MEUCIQDKwH560ieuyIsrDFQWZlgomHMawRjSrC/F1xrs/WIWGAIgX6Ohpl+l2vzy5IoJ67GzTwP0PLRf+XnmCTrVm2bqMQw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"private-eye.js","_from":".","_shasum":"dd0605eefd996c04e6f6954cb243e1a576e71ee0","gitHead":"5a1cf5f277f3f31eca3ba5a512a834ba1b3c7c9e","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"},"repository":{"url":"git+https://github.com/18F/private-eye.git","type":"git"},"_npmVersion":"3.7.3","description":"A JavaScript plugin to warn users about links to private pages.","directories":{},"_nodeVersion":"5.6.0","_npmOperationalInternal":{"tmp":"tmp/private-eye-1.1.0.tgz_1459458131725_0.7210689221974462","host":"packages-12-west.internal.npmjs.com"}},"2.0.0":{"name":"@18f/private-eye","version":"2.0.0","keywords":["private","link","browser","href"],"author":{"name":"Aidan Feldman","email":"aidan.feldman@gsa.gov"},"license":"CC0-1.0","_id":"@18f/private-eye@2.0.0","maintainers":[{"name":"adam.biagianti","email":"adam.biagianti@gsa.gov"},{"name":"jseppi","email":"james.seppi@gmail.com"},{"name":"mbenari","email":"hello@maya-benari.com"},{"name":"juliaelman","email":"hello@juliaelman.com"},{"name":"stvnrlly","email":"stvnrlly@stvnrlly.com"},{"name":"mgwalker","email":"npm@darkcooger.net"},{"name":"rogeruiz","email":"hi@rog.gr"},{"name":"noahmanger","email":"noah.manger@gmail.com"},{"name":"jmcarp","email":"jm.carp@gmail.com"},{"name":"msecret","email":"msegreto@miceover.com"},{"name":"jeremiak","email":"jbkimelman@gmail.com"},{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"},{"name":"18f-devops","email":"devops@gsa.gov"}],"homepage":"https://github.com/18F/private-eye#readme","bugs":{"url":"https://github.com/18F/private-eye/issues"},"dist":{"shasum":"a0c4d685923f90aaf18378fb8ae54f37d6fd276f","tarball":"https://registry.npmjs.org/@18f/private-eye/-/private-eye-2.0.0.tgz","integrity":"sha512-2ZiJSw/frar1pvp+wvRMyvFepVhulN08An9T+y1A8Psfssb72RPkwV9DLM56LO8mEMy/qV/d8e/eAZj1MiYPqA==","signatures":[{"sig":"MEUCIDf3CL18i/CsptZzzTfgy6B8Pih+wXT7iKSn41sFHQOrAiEAuZXuPUYr/efp6aNguWQcxPVGAqZqTEohA8/gzxBnnrk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"private-eye.js","gitHead":"e1fa48f4f0e1338d121f7322fbe317a8921ed774","scripts":{"test":"jest","test:watch":"jest --watch"},"_npmUser":{"name":"aidanfeldman","email":"aidan.feldman@gmail.com"},"repository":{"url":"git+https://github.com/18F/private-eye.git","type":"git"},"_npmVersion":"5.5.1","description":"A JavaScript plugin to warn users about links to private pages.","directories":{},"_nodeVersion":"8.0.0","devDependencies":{"jest":"^21.2.1"},"_npmOperationalInternal":{"tmp":"tmp/private-eye-2.0.0.tgz_1508176381969_0.290000932989642","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@18f/private-eye","version":"2.1.0","keywords":["private","link","browser","href"],"author":{"name":"Aidan Feldman","email":"aidan.feldman@gsa.gov"},"license":"CC0-1.0","_id":"@18f/private-eye@2.1.0","maintainers":[{"name":"tts-tech-portfolio","email":"tts-tech-portfolio@gsa.gov"},{"name":"18f-devops","email":"devops@gsa.gov"},{"name":"mgwalker","email":"npm@darkcooger.net"},{"name":"stvnrlly","email":"stvnrlly@stvnrlly.com"},{"name":"rori123","email":"rochelle.ribeiro@gsa.gov"},{"name":"aduth","email":"andrew@andrewduthie.com"}],"homepage":"https://github.com/18F/private-eye#readme","bugs":{"url":"https://github.com/18F/private-eye/issues"},"dist":{"shasum":"01ab64b7f7a2b8061a8f640875f56a3f14641c6f","tarball":"https://registry.npmjs.org/@18f/private-eye/-/private-eye-2.1.0.tgz","fileCount":90,"integrity":"sha512-CQZ2GGckIY91HBQlPVE12HNGPJN3bgvwYJBOC4R3tgTVkNbvdbmXhZycJ9htp9QlK5+I7dG7upm79gigpBqGfg==","signatures":[{"sig":"MEUCIEcjUcBnByxK8F+/1H79nL/MJdNO2OOFBq48nA4sq7fnAiEAjqcFZF3IDKLVPMBRNMuWOi88XndgVfoUp3AZQ8rMFFM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":3355056,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii4MrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqlvQ//cbMnmRJBhqQdb5O1bT/yMII/YJKBD27i2yZDYvnL4ve8pxiU\r\nNkrbY0RG5eSIhemiokP9HlRr/dN+fQMrV7FGzcgfmOvs6xUH2SCc5Rz8sj18\r\nxYucChyD1SuXIkl0s6P3SLxnuXJ1IUtYQzYBGOJnMHj+Hop1ntz4WcxY01Z3\r\n84osD8OqQ7glMcTjQzQw9g3njA7wSW/1S8FdXNA7mW1uSVmziYcwUcPE+O+6\r\nJReZI/6xucSXCE6IW1jHbMB7hsAsjglklZcZyox5a83cuXfQirPWxc2ZtKKj\r\nQJLyQKany+beis6EPtsIFkBRLS/NhrpXrGZeqWPElSbmAzgGXGnGSetzq/sY\r\nlL5KrB5pqw0qnumZFpHEtWZwbt0sKgJtM0XLpZ1qsMvXr8BGI+TRrZz622F4\r\nf1WoulKtdykf7Ixs7V6ujqL9DztZcmHeVqUwytxMtXksH5notI64Qo/J0ciB\r\nHEJD8RXI3Y70SFhfl4kDcSeUzwhO3ThWr7/3TURA+1rsrrdbwq5LT+uiz0L6\r\nd0XjYpxMRyELcJ8fwxmxJ756epC5/VrKWq7tWIKY9tSP6V3wQNGKf+Qd8MTu\r\nM/f62cHOic43dH5HSww8aTwOPXC8CINun1MosWFanQD4XZQh/NnWCNNAWwuE\r\n2jH9mXCHFIXYUq8+ipd03lufXNUmnGxzqQQ=\r\n=Jnal\r\n-----END PGP SIGNATURE-----\r\n"},"main":"private-eye.js","types":"./private-eye.d.ts","gitHead":"c08740d838eb2b95b318a916894c6cb6aae76e41","scripts":{"test":"jest","test:watch":"jest --watch"},"_npmUser":{"name":"aduth","email":"andrew@andrewduthie.com"},"repository":{"url":"git+https://github.com/18F/private-eye.git","type":"git"},"_npmVersion":"8.10.0","description":"A JavaScript plugin to warn users about links to private pages.","directories":{},"_nodeVersion":"14.18.2","_hasShrinkwrap":false,"devDependencies":{"jest":"^27.5.1"},"_npmOperationalInternal":{"tmp":"tmp/private-eye_2.1.0_1653310251279_0.2237069420444242","host":"s3://npm-registry-packages"}}},"time":{"created":"2016-01-14T00:16:38.086Z","modified":"2026-07-30T16:17:34.274Z","1.0.0":"2016-01-14T00:16:38.086Z","1.1.0":"2016-03-31T21:02:14.245Z","2.0.0":"2017-10-16T17:53:03.769Z","2.1.0":"2022-05-23T12:50:51.534Z"},"bugs":{"url":"https://github.com/18F/private-eye/issues"},"author":{"name":"Aidan Feldman","email":"aidan.feldman@gsa.gov"},"license":"CC0-1.0","homepage":"https://github.com/18F/private-eye#readme","keywords":["private","link","browser","href"],"repository":{"url":"git+https://github.com/18F/private-eye.git","type":"git"},"description":"A JavaScript plugin to warn users about links to private pages.","maintainers":[{"email":"devops@gsa.gov","name":"18f-devops"},{"email":"rochelle.ribeiro@gsa.gov","name":"rori123"},{"email":"sheldon@navapbc.com","name":"sb-nava"},{"email":"gina.yamada@gsa.gov","name":"ginayam"},{"email":"micah.neveu@gsa.gov","name":"mneveunava"},{"email":"tts-tech-portfolio@gsa.gov","name":"tts-tech-portfolio"},{"email":"michael.r.king@gsa.gov","name":"mkgsa"},{"email":"charles.ferguson@gsa.gov","name":"cvfergus"},{"email":"matt.gardner@gsa.gov","name":"nava-matt"},{"email":"keithwilliams@navapbc.com","name":"keithnava"},{"email":"tai@taigrr.com","name":"taigrr"},{"email":"luigi.ray-montanez@gsa.gov","name":"luigiraymontanez"},{"email":"john.jediny@gsa.gov","name":"jjediny"},{"email":"lakeisha.russell@gsa.gov","name":"lrussell01"},{"email":"gerardo.cruz-ortiz@gsa.gov","name":"gerardo.cruz-ortiz"},{"email":"aj.farkas@gsa.gov","name":"ajfarkas_gsa"}],"readme":"# Private Eye\n\n![detective image](assets/img/detective.png)\n\n<!-- c/o https://pixabay.com/en/detective-male-man-profile-156465/ -->\n\nA JavaScript plugin to warn users about links to private pages. Places a :lock: icon next to any links with any URLs that you specify as private, and gives a warning message.\n\nAt 18F, this is used on public sites that contain links to internal content like private GitHub repositories or Google Docs. Rather than write two versions to redact those links, this allows us to publish new content and give a warning to both staff and external readers.\n\n## Installation\n\nCompatible with modern browsers (IE 9+). No dependencies.\n\n### Script\n\nPrivate Eye can be included as a normal script on your page, exposing a `PrivateEye` global.\n\n```html\n<script src=\"private-eye.js\" defer></script>\n```\n\n### CommonJS\n\nPrivate Eye supports CommonJS, and is thus compatible with [Browserify](http://browserify.org/), [WebPack](https://webpack.github.io/), etc.\n\n1. Install the module.\n\n    ```bash\n    npm install --save @18f/private-eye\n    ```\n\n1. Include in your application:\n\n    ```javascript\n    var PrivateEye = require('private-eye');\n    ```\n\n## Basic Usage\n\nTo get started using Private Eye, initialize `PrivateEye` with an object\ncontaining an `ignoreUrls` property with a list of URLs to match.\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', function() {\n  new PrivateEye({\n    // list of URLs to match as substrings – can be full URLs, hostnames, etc.\n    ignoreUrls: [\n      'http://so.me/private/url',\n      'anoth.er',\n      // ...\n    ]\n  });\n}, false );\n```\n\n## Advanced Usage\n\nPrivate Eye supports custom messages for links.\nThe examples below provide different ways to customize a URL's messaging from\ngeneral to granular.\n\n### Reconfiguring the default message\n\nThe default message given to links can be configured across all private urls by\npassing in an option named `defaultMessage`. This property is added to the\nobject passed into `PrivateEye( { /*...*/ } );`.\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', function() {\n  new PrivateEye({\n    // Update the default message to a custom `string`.\n    defaultMessage: \"This link is secured, please ensure you have the proper credentials to access it.\"\n    ignoreUrls: [\n      'http://so.me/private/url',\n      'anoth.er',\n      // ...\n    ]\n  });\n}, false );\n```\n\nIn the example above, all URLs matched by `ignoreURLs` will have the customized\n`defaultMessage` as the message the user sees when they hover over the link.\n\n### Configuring custom messages for individual URLs\n\nCustom messaging is supported on a per-URL basis as well. This is done by\npassing an object in the `ignoreUrls` array with a `url` and `message` property\nfor the URL to match and the message to display respectively.\n\n```javascript\ndocument.addEventListener('DOMContentLoaded', function() {\n  new PrivateEye({\n    ignoreUrls: [\n      'http://so.me/private/url',\n      // Custom messages for individual URLs are passed in as an object.\n      {\n        url: 'anoth.er',\n        message: 'This is another link that may not be accessible to you without the proper credentials',\n      },\n      // ...\n    ]\n  });\n}, false );\n```\n\nIn the example above, the URL matches for `http://so.me/private/url` will have\nthe base default message. The URL matches for `anoth.er` will have a specific\ncustom message for _only_ those individual matches.\n\n### Using HTML to configure granular individual custom messages.\n\nCustom messaging is supported on a per-element basis. If a `title` attribute is\nfound on any matched `anchor`, the default or custom messaging is never set on\nthe `anchor`.  The original `title` attribute is left unmodified. This can be\nused to customize individual `anchor` elements on a more granular level.\n\n```javascript\n// Set up for the plugin is the same as \"Basic Usage\" above.\ndocument.addEventListener('DOMContentLoaded', function() {\n  new PrivateEye({\n    // list of URLs to match as substrings – can be full URLs, hostnames, etc.\n    ignoreUrls: [\n      'http://so.me/private/url',\n      'anoth.er',\n      // ...\n    ]\n  });\n}, false );\n```\n\n```html\n<!-- Base, or configured, default messaging for this link. -->\n<a href=\"http://so.me/private/url\">A private URL</a>\n<!-- Granluar custom message for only this specific element. -->\n<a href=\"http://so.me/private/url\" title=\"This link is still private and you may not have access to it.\">Another private URL</a>\n```\n\nIn the example above, the customized message is set as a `title` attribute on\none of the matched `anchor` elements. The first match without a `title`\nattribute will have the base default message. The second match with a `title`\nattribute will have the custom message found in `title`. This use case is\nparticularly useful if you HTML page already contains valuable messaging around\nprivate URLs, or if you'd like to configure the messaging without the need of\nusing JavaScript.\n\n### Target specfic section of the page\n\nTo only add the private icon lock onto the a specfic section of the page, pass in a CSS selector via the `wrapper` option.\n\n```js\ndocument.addEventListener('DOMContentLoaded', function() {\n  new PrivateEye({\n    // using the wrapper propety on the opts object - here, limiting to links under a tag with a \"private\" class\"\n    wrapper: '.private',\n    // list of URLs to match as substrings – can be full URLs, hostnames, etc.\n    ignoreUrls: [\n      'http://so.me/private/url',\n      'anoth.er',\n      // ...\n    ]\n  });\n}, false );\n```\n\n```html\n<div class=\"private\">\n    <a href=\"http://so.me/private/url\">A private URL that will get a lock</a>\n</div>\n<a href=\"http://so.me/private/url\">A private URL that will not get a lock</a>\n```\n\n## Developing\n\nTo get started developing, simply clone this repo and you're ready. Private Eye has no dependencies and does not have a build process. All code for Private Eye is located in `private-eye.js`.\n\nThis project uses `jest` for testing. First, run `npm install` which will install jest. Tests can be run with `npm test` or `npm test:watch` to rerun tests when files change.\n","readmeFilename":"README.md"}