{"_id":"@art-of-coding/procedure-caller","_rev":"2-dce7ab47871e48ce49619e5e5f49d03e","name":"@art-of-coding/procedure-caller","description":"Define and call procedures easily","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@art-of-coding/procedure-caller","version":"0.1.0","description":"Define and call procedures easily","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl","url":"http://michielvdvelde.nl"},"license":"MIT","keywords":["procedure","call","caller","define"],"engines":{"node":"=>4"},"repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/procedure-caller.git"},"bugs":{"url":"https://github.com/Art-of-Coding/procedure-caller/issues"},"homepage":"https://github.com/Art-of-Coding/procedure-caller","gitHead":"1bc8f9c17e40cc2caa119104beee1ba1b2201c9d","_id":"@art-of-coding/procedure-caller@0.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"},"dist":{"integrity":"sha512-Wy4r+T+zgMlk7y/c0jzT3erLZzbEnkzOBt4TSyIs64V/9AvExOOWQOhZy0ImQnb+3y+yiBb766i0ubu//FzWDg==","shasum":"19701de64f43621365112ba039603620727cb626","tarball":"https://registry.npmjs.org/@art-of-coding/procedure-caller/-/procedure-caller-0.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGX3PC/hIRrBVBVITvkQ2ORtuTOlmWnDxihcJgRHlPOgIhAInNNpCOA0Z8bLhqXcNEsg4ytRgsFMMFC/Yz/b0ihFoE"}]},"maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/procedure-caller-0.1.0.tgz_1503670375620_0.03593055112287402"}},"0.1.1":{"name":"@art-of-coding/procedure-caller","version":"0.1.1","description":"Define and call procedures easily","author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl","url":"http://michielvdvelde.nl"},"license":"MIT","keywords":["procedure","call","caller","define"],"engines":{"node":"=>4"},"repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/procedure-caller.git"},"bugs":{"url":"https://github.com/Art-of-Coding/procedure-caller/issues"},"homepage":"https://github.com/Art-of-Coding/procedure-caller","gitHead":"f3cc33d5921ff6dad5fedaf8ce575068343e9082","_id":"@art-of-coding/procedure-caller@0.1.1","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"},"dist":{"integrity":"sha512-/AAwBMwo9ws2BcZH9bxc0YJHxStM8SBKkBZwD8N0SNs6BfRUKqVe4tpHtjQX0Lu1Qii2GOOLFiH5NFJBfmCYEQ==","shasum":"bed39578827bd84c24e8fda2173ee220c9500137","tarball":"https://registry.npmjs.org/@art-of-coding/procedure-caller/-/procedure-caller-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfsMa7iLHV8ChOAmq0E+mVnNWueYrCLf5dCC6C5O2oaQIgRgNOZi80egeIh9WUAllLauS5O19vvr90fOT2XA+/EGI="}]},"maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/procedure-caller-0.1.1.tgz_1503678937811_0.27432801807299256"}}},"readme":"# procedure-caller\n\n[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nA simple, no-nonsense procedure caller.\n\n## Install\n\n```\nnpm i @art-of-coding/procedure-caller\n```\n\n## Example\n\n```js\nconst ProcedureCaller = require('@art-of-coding/procedure-caller')\n\n// Create a new ProcedureCaller\nconst pc = new ProcedureCaller()\n\n// Define an 'add' procedure\npc.define('add', function (a, b) {\n  return a + b\n})\n\n// Call the 'add' procedure\nconst result = pc.call('add', 5, 6)\n\n// And log the result\nconsole.log(`The result is ${result}`)\n```\n\n## API\n\n### `new ProcedureCaller()`\n\nInstantiates a new ProcedureCaller. Currently there are no arguments.\n\n### `pc.define(name, fn, override = false)`\n\nDefines a procedure by the given `name`.\n\n* `name`: The name of the procedure\n* `fn`: The procedure function\n* `override`: Override if a procedure with this name already exists (default `false`)\n\n### `pc.call(name, ...args)`\n\nCalls the procedure with the given `name` and returns the result.\n\n* `name`: The name of the procedure\n* `...args`: Zero, one or more arguments for the procedure\n\n### `pc.delete(name, failSilently = true)`\n\nDeletes the procedure with the given `name`.\n\n* `name`: The name of the procedure\n* `failSilently`: Don't throw an error if `name` is not defined\n\n[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\n## License\n\nCopyright 2017 [Art of Coding](http://artofcoding.nl).\n\nThis software is licensed under the [MIT License](LICENSE).\n","maintainers":[{"name":"michielvdvelde","email":"michiel@michielvdvelde.nl"}],"time":{"modified":"2022-04-04T15:35:54.472Z","created":"2017-08-25T14:12:56.540Z","0.1.0":"2017-08-25T14:12:56.540Z","0.1.1":"2017-08-25T16:35:38.765Z"},"homepage":"https://github.com/Art-of-Coding/procedure-caller","keywords":["procedure","call","caller","define"],"repository":{"type":"git","url":"git+https://github.com/Art-of-Coding/procedure-caller.git"},"author":{"name":"Michiel van der Velde","email":"michiel@michielvdvelde.nl","url":"http://michielvdvelde.nl"},"bugs":{"url":"https://github.com/Art-of-Coding/procedure-caller/issues"},"license":"MIT","readmeFilename":"README.md"}