{"_id":"@deskeen/web-builder-add-hash-filename","_rev":"1-3979805864b4b3d72709f6c0e3b8cd17","name":"@deskeen/web-builder-add-hash-filename","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@deskeen/web-builder-add-hash-filename","version":"0.1.0","description":"Web Builder Module - Add Hash to Filename","author":{"name":"Morgan Schmiedt"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/deskeen/web-builder-add-hash-filename.git"},"keywords":["build","website","node.js","hash","filename","cache"],"main":"src/module.js","gitHead":"42769decbb7d22c50355c8d972b1893875b5aaf4","bugs":{"url":"https://github.com/deskeen/web-builder-add-hash-filename/issues"},"homepage":"https://github.com/deskeen/web-builder-add-hash-filename#readme","_id":"@deskeen/web-builder-add-hash-filename@0.1.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-3OXiZNFBWsIsAkyDMa8TSjBemL8QHHflxZsRZ3gOxT8w3UENyLg70fmf7KKbHGXMAPlAY7qy7GKt0s0Sm2JGLg==","shasum":"24aec76d787ca2195b489fc4115da5b6c13c920a","tarball":"https://registry.npmjs.org/@deskeen/web-builder-add-hash-filename/-/web-builder-add-hash-filename-0.1.0.tgz","fileCount":5,"unpackedSize":14159,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZHI1CRA9TVsSAnZWagAAljkP/3ZC7nzIKInd90yLkouc\nrg2TE2ot21vaaqBIjQX+wcS+r/Tp/OK0LzBn0OdBFfculvV5RDgiy3eWX/up\nVJvAhfox3fggG7P3MC8UhacfFXDCORseqTzD0X9v7CJiIlWlyQwMQ7DJLL72\ngSKtPs5Du/bwI2s412DBdBSB7OjLm97yawJlKAQud7kuougNR2fM/Yhc0dRv\n9KOsMx6wkPRvCJqeB3Ac5sbKufqAFgaWMCW0aes/Im3FmWW40uOlKl5PbD9S\neGwk61veYK0uPHbHb0JCAgzpfke6GYS6NXNoc60/FSSnAS9gw3gQr6a1h6ST\noWdS9Vs05JOLH0IZDNjRZuGS5BJ2HnwQR2Xlpybg8yxsT0Rg2PS3txWzlwp1\n7hAcibSYoD3I6IBLtJNa6Q5eps+hu1ml6QvWwK44IE6KM0uJkJd2ZpJ7CXcJ\nyHC8ge81PyqtrvRF9c+AylJm08/+dO8Rga+FH7EyQKwH7JLRJkR4NQze7L0I\nFSS26tkadwLBrFNi4FX+OTMC5Ljxi1dAi111JVxhjIirOsmwE7mKSJThcQY5\n7p64CrV1oFr8xc2Virl8pnwLit1m8vwS8Vaja6oU9/9082ub3jcCbAn4NOV8\n6hDCNUFk2VR+/7CK6vlDY9X6KiaiQvGtbvDGaJSsJrQSF3QBomz13Pj7FmGk\n1F2n\r\n=XlZO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVRtF5nYoD/ZoJPYkrSQ3PcQaG/3n1Gi9IwlAUQ9ebFQIgK+lpievDqZcyGjy3GtAIWz9mFCT9NzgvkaMUoaDnIgo="}]},"maintainers":[{"name":"deskeen","email":"npm@morgan.schmiedt.fr"}],"_npmUser":{"name":"deskeen","email":"npm@morgan.schmiedt.fr"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/web-builder-add-hash-filename_0.1.0_1600418357356_0.30562201041870374"},"_hasShrinkwrap":false}},"time":{"created":"2020-09-18T08:39:17.312Z","0.1.0":"2020-09-18T08:39:17.466Z","modified":"2022-04-05T04:00:07.108Z"},"maintainers":[{"name":"deskeen","email":"npm@morgan.schmiedt.fr"}],"description":"Web Builder Module - Add Hash to Filename","homepage":"https://github.com/deskeen/web-builder-add-hash-filename#readme","keywords":["build","website","node.js","hash","filename","cache"],"repository":{"type":"git","url":"git+https://github.com/deskeen/web-builder-add-hash-filename.git"},"author":{"name":"Morgan Schmiedt"},"bugs":{"url":"https://github.com/deskeen/web-builder-add-hash-filename/issues"},"license":"MIT","readme":"## Web Builder Module - Add Hash to Filename\r\n\r\nThis module allows the [@deskeen/web-builder](https://github.com/deskeen/web-builder) to add the file hash to the file names.\r\n\r\n\r\n## Install\r\n\r\n```\r\nnpm install @deskeen/web-builder\r\nnpm install @deskeen/web-builder-add-hash-filename\r\n```\r\n\r\n\r\n### Usage\r\n\r\nAdd the module to the list of modules: \r\n\r\n```javascript\r\nconst builder = require('@deskeen/web-builder')\r\nawait builder.build({\r\n  source: [\r\n    // List of files or directories that include inlineSVG tags\r\n    // {{inlineJSON:file.json}}\r\n  ],\r\n  modules: [\r\n    [\r\n      '@deskeen/web-builder-add-hash-filename',\r\n      {\r\n        // Starting points\r\n        // Can be a function or a list of files\r\n        entries: file => file.endsWith('.html'),\r\n        assets: [\r\n          // List of directories that include the files\r\n          // noted in the addHash tags\r\n        ],\r\n      }\r\n    ]\r\n  ]\r\n})\r\n```\r\n\r\n\r\n### Example\r\n\r\nLet's consider the following files:\r\n\r\n*/www/index.html*\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <meta charset=\"utf-8\">\r\n    <link href=\"{{addHash:style.css}}\" rel=\"stylesheet\" type=\"text/css\">\r\n    <title>Pink is the new Black</title>\r\n  </head>\r\n  <body>\r\n    <!-- My cool page -->\r\n  </body>\r\n</html>\r\n```\r\n\r\n*/www/css/style.css*\r\n```css\r\nbody {\r\n  background-color: pink;\r\n}\r\n```\r\n\r\nBuild the project by running:\r\n```javascript\r\nawait builder.build({\r\n    source: ['/www'],\r\n    modules: [\r\n      [\r\n        '@deskeen/web-builder-add-hash-filename',\r\n        {\r\n          entries: file => file.endsWith('.html'),\r\n          assets: ['/www/css'],\r\n        }\r\n      ]\r\n    ]\r\n  })\r\n```\r\n\r\nTwo things happen:\r\n- The index file now contains: `<link href=\"style.cb163438387622e1354d9613a8f44dfa.css\"`\r\n- The style file is renamed to: `style.cb163438387622e1354d9613a8f44dfa.css`\r\n\r\n\r\n## Contact\r\n\r\nYou can reach me at {my_firstname}@{my_name}.fr\r\n\r\n\r\n## Licence\r\n\r\nMIT Licence - Copyright (c) Morgan Schmiedt","readmeFilename":"README.md"}