{"_id":"@auser/metalsmith-watch","_rev":"3-181ef1f7cc5651f7ab058796845753c1","name":"@auser/metalsmith-watch","description":"Metalsmith plugin to watch for changes and trigger partial and full rebuilds","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.4":{"name":"@auser/metalsmith-watch","version":"1.0.4","description":"Metalsmith plugin to watch for changes and trigger partial and full rebuilds","keywords":["metalsmith","metalsmith-plugin"],"authors":["Fabrice Weinberg","Maxime Thirouin"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/FWeinb/metalsmith-watch.git"},"files":["dist"],"main":"dist/index.js","dependencies":{"async":"^0.9.0","chalk":"^1.0.0","gaze":"^1.0.0","metalsmith-filenames":"^1.0.0","multimatch":"^2.0.0","tiny-lr":"^0.1.5","unyield":"0.0.1"},"devDependencies":{"babel":"^5.1.13","babel-eslint":"^3.0.1","babel-tape-runner":"^1.1.0","eslint":"^0.20.0","metalsmith":"^1.7.0","mkdirp":"^0.5.0","npmpub":"^3.1.0","rimraf":"^2.3.3","tape":"^4.0.0"},"scripts":{"prepublish":"babel src --out-dir dist","lint":"eslint .","tape":"babel-tape-runner \"__tests__/*.es\"","test":"npm run lint && npm run tape","release":"npmpub"},"gitHead":"585d24cb6d6c18e5096b80a2f4e6bcd67aac2343","bugs":{"url":"https://github.com/FWeinb/metalsmith-watch/issues"},"homepage":"https://github.com/FWeinb/metalsmith-watch#readme","_id":"@auser/metalsmith-watch@1.0.4","_shasum":"dee4c29c2af38c50817bc03cbdfd39ec04d982b1","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.1.0","_npmUser":{"name":"auser","email":"arilerner@mac.com"},"dist":{"shasum":"dee4c29c2af38c50817bc03cbdfd39ec04d982b1","tarball":"https://registry.npmjs.org/@auser/metalsmith-watch/-/metalsmith-watch-1.0.4.tgz","integrity":"sha512-8lptalr7A61QoBdbKzejCWQu1KP38Ows4Iq8oz4PIHInqziFkmzBHy+JUekTJcBExQzj0vFmhCcAqN8Y9mTWcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUqrYQm47mACaumUzYn0BjlqB9MwLRTgcOEA6R8ahXwAiEAkAIMaH4lnSlKfR4w/2KNP8m/gYAEJ+1aYAOHNLCLFoo="}]},"maintainers":[{"name":"auser","email":"arilerner@mac.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/metalsmith-watch-1.0.4.tgz_1478855034981_0.8351998711004853"}}},"readme":"# metalsmith-watch [![Build Status](https://travis-ci.org/FWeinb/metalsmith-watch.svg?branch=master)](https://travis-ci.org/FWeinb/metalsmith-watch) [![NPM version](http://img.shields.io/npm/v/metalsmith-watch.svg?style=flat)](https://www.npmjs.org/package/metalsmith-watch)\n\n> Metalsmith plugin to watch for changes and trigger partial and full rebuilds.\n\n## Installation\n\n```console\n$ npm install metalsmith-watch\n```\n\n## Usage\n\n```js\nvar metalsmith = require('metalsmith');\nvar watch = require('metalsmith-watch');\n\nmetalsmith(__dirname)\n  .use(\n    watch({\n      paths: {\n        \"${source}/**/*\": true,\n        \"templates/**/*\": \"**/*.md\",\n      },\n      livereload: true,\n    })\n  )\n  .build();\n```\n\n## Options\n\n### paths (default: `{\"${source}/**/*\": true}`)\n\nMap of paths to trigger rebuild. Both keys and value accept a [glob pattern](https://github.com/isaacs/node-glob).\n\n```js\n{\n  \"file(s) to watch\": \"file(s) to rebuild\"\n}\n```\n\nValue accept a boolean. When a boolean is used, only watched files changed will be rebuilded.\n\n```js\n{\n  \"${source}/**/*\": true, // every changed files will trigger a rebuild of themselves\n  \"templates/**/*\": \"**/*\", // every templates changed will trigger a rebuild of all files\n}\n```\n\n**Please note that**:\n- `${source}` is replaced by `metalsmith.source()`.\n- _values of the map are relative to `metalsmith.source()`_ (because it's the only place where to build files)\n\n\n### livereload (default: `false`)\n\nAllows you to enable a livereload server.\nUsing a boolean will enable a livereload server on port the default port is `35729`.\nAccept a port number to start on the port you need.\n\nTo get live reload working properly, you should add the following `<script>` in your templates files to enable livereloading of each pages:\n\n```html\n<script src=\"http://localhost:35729/livereload.js\"></script>\n```\n\nMake sure to update the port number in the script above accordingly to the port specified.\n\n### onUpdateCallback (default: `undefined`)\n\nAllows you to define a function to get called _after_ metalsmith has reloaded all the files. If a function is passed, this will be called with the updated files and all options passed.\n\n```javascript\n{\n  onUpdateCallback: function (files, options) {\n    // Called on every rebuild\n  }\n}\n```\n\n### log (default: `function(...args) { console.log(prefix, ...args)}`)\n\nFunction used to display the logs.\n\n### invalidateCache (default: `true`)\n\nAllows you to enable cache invalidation for js files.\nConvenient if you use some js files for templates\n(eg: React templates) to get updated components.\nIf disabled you won't get update for changed js files as node/iojs use a cache.\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE.md)\n","maintainers":[{"name":"auser","email":"arilerner@mac.com"}],"time":{"modified":"2022-06-12T14:52:17.980Z","created":"2016-11-11T09:03:55.207Z","1.0.4":"2016-11-11T09:03:55.207Z"},"homepage":"https://github.com/FWeinb/metalsmith-watch#readme","keywords":["metalsmith","metalsmith-plugin"],"repository":{"type":"git","url":"git+https://github.com/FWeinb/metalsmith-watch.git"},"bugs":{"url":"https://github.com/FWeinb/metalsmith-watch/issues"},"license":"MIT","readmeFilename":"README.md"}