## Usage ```js const Pkg = require('{%= name %}'); ``` ## API Extends [cache-base][], please see the `cache-base` documentation for more details. {%= apidocs("index.js") %} ### .set ```js pkg.set(key, value); ``` Set property `key` with the given `value`. **Example** ```js // given {"name": "my-project"} pkg.set('bin.foo', 'bar'); console.log(pkg.data); //=> {"name": "my-project", "bin": {"foo": "bar"}} ``` ### .get ```js pkg.get(key); ``` Get property `key` from package.json. **Example** ```js // given {"name": "my-project"} pkg.set('bin.foo', 'bar'); console.log(pkg.get('bin')); //=> {"foo": "bar"} ``` ### .has ```js pkg.has(key); ``` Returns `true` if `package.json` has property `key`. **Example** ```js // given: {"name": "my-project"} console.log(pkg.has('name')); //=> true console.log(pkg.has('zzzzzzz')); //=> false ``` ### .union ```js pkg.union(key, val); ``` Create array `key`, or concatenate values to array `key`. Also uniquifies the array. **Example** ```js pkg.union('keywords', 'foo'); pkg.union('keywords', ['bar', 'baz']); console.log(pkg.get('keywords')); //=> ['foo', 'bar', 'baz'] ```