{"_id":"@defra-design/extra-filters","_rev":"2-8fc5e51d7b5d0df734c68dd266d3ff17","name":"@defra-design/extra-filters","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@defra-design/extra-filters","version":"1.0.0","description":"a package for extending the filters on a prototype","main":"index.js","scripts":{"postinstall":"node copyFile.js","autosetup":"node autoSetup.js"},"author":"","license":"MIT","repository":{"type":"git","url":"git://github.com/defra-design/extra-filters.git"},"gitHead":"b65dc99941960dce0bf712a28415aba2d8324cf3","bugs":{"url":"https://github.com/defra-design/extra-filters/issues"},"homepage":"https://github.com/defra-design/extra-filters#readme","_id":"@defra-design/extra-filters@1.0.0","_nodeVersion":"12.18.3","_npmVersion":"7.22.0","dist":{"integrity":"sha512-59FweE2JiEBp8vtYEoPtOr9I48RQ8YEu9ltvG4Zleen0htuxpWDcHHGCJrYYbt4bE5OrM4j/MzTGb2lc4tWlZA==","shasum":"e9437f229d5cc6e87ae78710024ab2b6786ccf18","tarball":"https://registry.npmjs.org/@defra-design/extra-filters/-/extra-filters-1.0.0.tgz","fileCount":7,"unpackedSize":18467,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzstuCRA9TVsSAnZWagAADWMQAJCQwgVev0ztTKqqsYRT\nff3LF4Zeh6Fa9VU7jrnBpR37ZCPEFgu7nMQwSFPDSn6U/Ws5o56L6aAHBaJl\nb9xk4Z0F1P8eK6K2kBvpF7XJj/p0WSTEqXOpP1JkAX8jSbx8JDrxWpwCugfU\nZkU+5XV7JZakTxDJQxFjFgv2PS59VX4TWp77qCQ/K6Lrl0Q13jzI/hK7Laue\nwflV/taBo/EoJ5pLXX2Vcmxsugk+PJ97nnYqr7b+GgqEK7h0xpq0O10X+PHY\nEd3IbF/E0/ozabkaBEypK8H35rrAUgeABKDbcRqkXl6i35NKehskYRp1hIda\nMKm1SlvwvA42eq9Q7db0Rk3DF72JgtkOslHG2eHm5gV3FJl/s3BJwh5iyHje\nvrARmZ197x9C3TcjGzAGwdPQMAGrYJiCZkbG7luKXqMOLO7k5i627dDebfsQ\nbdly9QvKEu6gqcPrVlW6T1pbkiUJNYbrmWmZCT9/bShut2jv58v5VLpGhg6g\nwzJFXXnw686BK0nPUwviseHkrt1NcyBwmtU4FWG9JZqnwOd4P67khFxbG/Xf\nT2H8NCsFMywTN+NG1HFH3b2akmIhwXbtBkhMwfmHHcNK7GxiRG4RIBLLCUnG\nXUVjcltgzXlFZwpebBZnQbFB/zSCcOIGVYgaa52iYRbxprdiTN+kDgXYWF8b\nu4TE\r\n=DM5F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjhapo8oDAr9nKYUWCf2eKLnkYQiTof3Up5V/zKvORiAiA1zE/cCqmVaFX5DqrIMtKO6UG2IlAfKdGBY8h/KvMfow=="}]},"_npmUser":{"name":"christopherbarrett","email":"Chris.Barrett@defra.gov.uk"},"directories":{},"maintainers":[{"name":"tom-frankland","email":"tom.frankland@defra.gov.uk"},{"name":"christopherbarrett","email":"Chris.Barrett@defra.gov.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/extra-filters_1.0.0_1634397325975_0.6936656210119547"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-16T15:15:25.920Z","1.0.0":"2021-10-16T15:15:26.192Z","modified":"2022-04-05T03:39:00.005Z"},"maintainers":[{"name":"tom-frankland","email":"tom.frankland@defra.gov.uk"},{"name":"christopherbarrett","email":"Chris.Barrett@defra.gov.uk"}],"description":"a package for extending the filters on a prototype","homepage":"https://github.com/defra-design/extra-filters#readme","repository":{"type":"git","url":"git://github.com/defra-design/extra-filters.git"},"bugs":{"url":"https://github.com/defra-design/extra-filters/issues"},"license":"MIT","readme":"# extra-filters\n\n## About the module\n\nThis is a module that extends the filter functionality of the gov-uk prototype kit, by adding an extra-filters file.\n\nThe extra-filters file contains a list of custom filters that help to solve common prototyping challenges.\n\n## Installation instructions\n\n`npm install @chrissybarrett/extra-filters`\n\nThis will copy the _extra-filters.js_ file to your prototype.\n\nThe next step is to include the file into the application. You can either modify your _utils.js_ file\n(`app/views/lib/util.js`) to reference the new file or run the _autoSetup.js_ script to do this automatically. \n\nModify the _utils.js_ file by inserting the new filters into the existing _addNunjucksFilters_ function, eg:\n\n```JavaScript\nexports.addNunjucksFilters = function (env) {\n  var coreFilters = require('./core_filters.js')(env)\n  var customFilters = require('../app/filters.js')(env)\n  var extraFilters = require('../app/extra-filters.js')(env) \n  var filters = Object.assign(coreFilters, customFilters, extraFilters)\n  Object.keys(filters).forEach(function (filterName) {\n    env.addFilter(filterName, filters[filterName])\n  })\n}\n```\n\nOr you can run the autosetup script. To run the autosetup script.\n\n`cd /{Your prototype directory}/node_modules/@chrissybarrett/extra-filters`\n\n  `npm run autosetup`\n        \n## Contributing\n\nIf you’ve got an idea or suggestion you can:\n\n* [get in touch with me on slack] @ChrisBarret_defra\n","readmeFilename":"README.md"}