{"_id":"@7rabbit/ink","_rev":"2-d72d7debff9ff7d9b0baa49cb82da422","name":"@7rabbit/ink","dist-tags":{"latest":"0.10.0"},"versions":{"0.9.0":{"name":"@7rabbit/ink","version":"0.9.0","description":"Lean Enterprise Architecture Distribution","keywords":["react","frontend","backend","fullstack"],"author":{"name":"Lance Pollard","email":"lp@elk.fm","url":"https://7.rabbit.cx"},"bugs":{"url":"https://github.com/7rabbit/ink/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/7rabbit/ink.git"},"gitHead":"11f060c21f4369c1314179212d80021c42f56142","homepage":"https://github.com/7rabbit/ink#readme","_id":"@7rabbit/ink@0.9.0","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-DsWi0Vj/cTf+a+7B6o3SSyalIkGJz0eFhV2yMhxkq1JXFP0iosThsAgQSPg3tQoQzYMXdurY0q7DGZzyadJlLQ==","shasum":"b1c0b33536c39919178f2ddea7800105369df5a7","tarball":"https://registry.npmjs.org/@7rabbit/ink/-/ink-0.9.0.tgz","fileCount":3,"unpackedSize":5448,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdRjm3CRA9TVsSAnZWagAAxfgP/2J+3uIAdfmqecIuKCk1\na2Q/J5vQel0MGgSZjt8VfJZcSTnjRNTJ2SP8N3WFEvHBz02iy6Lg5+FvP6M2\nTkGISBnuNLS/f8y/5fr9AGtSzFDptspHpeJvAi+und2DutqrhWRPgTWxgaA/\n5xSB27aZ+Mqo7A+V3MuIjy8wcIzE80wjSwFXut0cTsGZMoySsAfHTFFkcQ4n\n+ZconmOQvR6TnfJgGQSizCbVrRezomBNon/5msgNqTOhcjDIUoCzJKmRsYrw\ngx8KrajgzHtT4ahBKjLUw1c1XE06ytJE0eFJLgaKbS0A09LRaWsTSevwniB9\nMybl5GlMzEKLlKwQDdCB6F3ST1j4nDVUdN2dLXcpfW+vRX7CLGv+V/HkkpbP\n/u00T9LfixuOe8x4ApsujXMdAu/z9Kvil1XMr+zsZaG7X6BKyp2NOK2v6jr3\n7zsIfg9OYY+tiw/+RGRrtlw4Ikam+lXHlOkDQncBfHt7oDeXoq4opRVxhugm\nzfldak8s3uNZWYlmlmmR0Ssc7aE7SFc4WsSjuSncUzD6QTC69knzqLqN/R9K\nycO+MK11O1JVmWt0Vi1nJ7yCv5ATgUM7jbvcEGfjuAnMvhaG2go+RRsV4A0c\nKEpypxtmFU6/EQquNZU+ToxY/00sTF6WcMl/SOiflb8L2YIW8b6pAXsI/6CA\nb/aI\r\n=fwIH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDAbt1LCN6zmYziIMNvSN+OAQxWNdEtE26c/Xk3STW/2AiEA0PIBGCfMEnbPSqqxPoKya7rt0Lp5ZWm2PvIUamvO1UI="}]},"maintainers":[{"name":"lancejpollard","email":"lp@elk.fm"}],"_npmUser":{"name":"lancejpollard","email":"lp@elk.fm"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ink_0.9.0_1564883382472_0.11577249476295792"},"_hasShrinkwrap":false},"0.10.0":{"name":"@7rabbit/ink","version":"0.10.0","description":"Lean Enterprise Architecture Distribution","keywords":["react","frontend","backend","fullstack"],"author":{"name":"Lance Pollard","email":"lp@elk.fm","url":"https://7.rabbit.cx"},"bugs":{"url":"https://github.com/7rabbit/ink/issues"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/7rabbit/ink.git"},"gitHead":"00ad0efe4da3ed55d7d02315636ad24af295b3ed","homepage":"https://github.com/7rabbit/ink#readme","_id":"@7rabbit/ink@0.10.0","_nodeVersion":"12.7.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-RwyscT/XRXbY7vCJxLpUuopsRPFOHmAORTJMILE3PWEurztz/gitk90WBBiR6opFCeRJv0NJOcCjwxctxSGitg==","shasum":"acc007cf463364441103412d373402eb22b0645f","tarball":"https://registry.npmjs.org/@7rabbit/ink/-/ink-0.10.0.tgz","fileCount":3,"unpackedSize":7827,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdlIB+CRA9TVsSAnZWagAAZv8P/jys3xkdgYQum20tu633\n1qPyuVZopwxW7XZZAVkRuaYkfWoIWHWD5Z/66HPsa6XiICu1Z9YcgOHjDZol\naH3K4zvFf1BvYiE/FTZJIqVy+TlD5B4fr2hc2RS9O+ZAZLSye6e7gfJtINFW\newqOZEGv+3nxutHHevf/1drlFIY6sZiA1RoyrL2Yo843WBHKtNtc7lmRh9Gv\nnz1q1qoxJw+TFKrvS3phxl1Z8dQ5VPa6/z9pRGo5IM1bkgMBdRB61uz8/gQ9\nvay72M9pfGlnvqpVug/hgpPxvLN1my2b4ya4CrpcOfcCKKTcuIxfKZMkDlxR\nEEgilYKHphX7j7RzoaZSh4c3vhk4Vwk1yY4y8sVZenqKlVoTTX76PFHwybhL\nnb8lQQTU8zmqItaWCC3ykrSScpLvTuL0gAehSXbVxRevGd0MfJgykf2O8B4q\noPHzUD/6qHrUZXZqIJjC8F4N7ctWnsxhzsMvlbMhFKaaf9dcWvwbOSjHlUSw\nRmOli1xw4cawuHRuEHS53EeTl98sj4I36/v60MEymQbKORiBn8RcURhehsE8\n4Mp3WAhtAspumMiEgPTXdMLrMRAy0czSpL4MRHNQhBEIOmfGkP3i9WDBj0yl\nKWxaa6epXEC9b+JRT02xLMOiAbJqIJa4hcZSBby36Mk1LnzS500oRL2n8XYH\nLCsa\r\n=xb3R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqPgMiOGn3cEpfMmT2V9np/SG4esDFyLIlMKzrDWtp4AiADboaw7QSijOSCMohzzNhKGpabewWVrS//zOvu1ar7fQ=="}]},"maintainers":[{"name":"lancejpollard","email":"lp@elk.fm"}],"_npmUser":{"name":"lancejpollard","email":"lp@elk.fm"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ink_0.10.0_1570013310057_0.9257559267190507"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-04T01:49:42.266Z","0.9.0":"2019-08-04T01:49:42.627Z","modified":"2022-04-04T10:49:25.799Z","0.10.0":"2019-10-02T10:48:30.188Z"},"maintainers":[{"name":"lancejpollard","email":"lp@elk.fm"}],"description":"Lean Enterprise Architecture Distribution","homepage":"https://github.com/7rabbit/ink#readme","keywords":["react","frontend","backend","fullstack"],"repository":{"type":"git","url":"git+https://github.com/7rabbit/ink.git"},"author":{"name":"Lance Pollard","email":"lp@elk.fm","url":"https://7.rabbit.cx"},"bugs":{"url":"https://github.com/7rabbit/ink/issues"},"license":"MIT","readme":"\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n<br/>\n\n<p align=\"center\">\n  <a href=\"https://7.rabbit.cx/ink\">\n    <img src=\"https://7.rabbit.cx/ink/mark.png\" width=\"128\"/>\n  </a>\n</p>\n\n<br/>\n<br/>\n<br/>\n<br/>\n\n<h3 align=\"center\">ink</h3>\n<p align=\"center\">\n  Lean Enterprise Architecture Distribution\n</p>\n\n<br/>\n<br/>\n\n<p align=\"center\">\n  <a href=\"#introduction\">Introduction</a> •\n  <a href=\"#installation\">Installation</a> •\n  <a href=\"#illustration\">Illustration</a>\n</p>\n\n<br/>\n<br/>\n<br/>\n\n### Introduction\n\nAll small and medium sized companies suffer the same problem: code is a mess and disorganized, there are multiple different naming conventions, folder and file conventions, and implementation conventions. Actions are classified in different ways and placed into different files and modules, which makes sense to some and is difficult to understand for others. There is not much consistency in the implementation of the look and feel, and CSS is all over the place in different implementations. Overall, there is no clear and systematic approach to the frontend that cleans up the conventions and implementation styles and at the same times keeps it simple.\n\nThis project is a solution to this problem. It is very few lines of code and is freely and openly licensed so it can be used at any company. All it does is create a convention to place all of your actions in one place, and actions manage state. As you will learn this solves the problem of managing vendor lockin, of testability of the code, of centralizing the knowledge base and of knowing where to find things. It is not an over-abstraction, it just treats everything as they are: as actions. All actions start at one state and end at another. If there are two main things in programming they are objects and actions. This project manages them both without any dependencies, so it is as secure as it can be.\n\nCompanies looking to take control of their code should start here. Gain control over the actions in the application. Shed the excess files that kept the actions siloed. Write tests for each action to verify its behavior. This will help improve the codebase. In addition, save the objects of your actions here. Keep configuration and settings and arbitrary data in one place to ease debuggability. To make it simple to stub out a complicated action. To help ease newcomers into the code, so they don't have to weed through a complicated network of imports and files. This will make the code easier to understand for everyone, and will increase the velocity at which product is developed.\n\n### Installation\n\n```bash\nnpm install @7rabbit/ink\n```\n\n<br/>\n\n### Illustration\n\nInk is a glorified \"store\". All a store is is \"state\", they both mean the same thing. We have taken one step further to take that \"state\" of _one_ type of \"thing\" and created _two_ types of things to simplify development: actions and objects. An action in JavaScript is simply a function. A function takes input and optionally returns output or otherwise causes an effect (or does nothing). An object is a piece of data, whether itself a function, or better, an object, set of bits, or an array, string, number, regex, etc.\n\nThis is a Hello World example.\n\n```js\nimport Ink from '@7rabbit/ink'\n\nlet ink = new Ink()\nink.attachModule(attachLogger)\nink.invokeAction('log', 'hello world')\nink.detachModule(attachLogger)\nink.invokeAction('log', 'hello world')\n\nfunction attachLogger(ink) {\n  ink.attachAction('log', log)\n\n  return detachModule\n\n  function detachModule() {\n    ink.detachAction('log')\n  }\n\n  function log(x) {\n    console.log(x)\n  }\n}\n```\n\nThe rest of what follows is an API reference documenting every method on the `ink` object.\n\n#### `commitObject(name, object)`\n\nStores an `object` by the key `name`.\n\n#### `attachObject(name, object)`\n\nIf there already is an object stored by key `name`, then it throws an error, otherwise it stores `object` by the key `name`.\n\n#### `selectObject(name)`\n\nReturns the object with the key `name`.\n\n#### `expectObject(name)`\n\nIf there is not an object stored by key `name`, then it throws an error, otherwise it returns the object with the key `name`.\n\n#### `detachObject(name)`\n\nRemoves the object under the key `name` from the store.\n\n#### `commitAction(name, action)`\n\nStores an `action` by the key `name`.\n\n#### `attachAction(name, action)`\n\nIf there already is an action stored by key `name`, then it throws an error, otherwise it stores `action` by the key `name`.\n\n#### `selectAction(name)`\n\nReturns the action with the key `name`.\n\n#### `expectAction(name)`\n\nIf there is not an action stored by key `name`, then it throws an error, otherwise it returns the action with the key `name`.\n\n#### `detachAction(name)`\n\nRemoves the action under the key `name` from the store.\n\n#### `invokeAction(name, ...args)`\n\nCalls the action under the key `name` with `args`.\n\n#### `attachModule(module)`\n\nApplies the function `module` to the store.\n\n#### `detachModule(module)`\n\nUnapplies the function `module` to the store.\n","readmeFilename":"readme.md"}