{"_id":"@codeb/pleasejs","_rev":"2-3bb6265c3ba3b8a07e1170fcd2ec6f0f","name":"@codeb/pleasejs","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@codeb/pleasejs","version":"1.0.0","description":"🙌 Please.js is the polite way of building a javascript util library for any project.","main":"dist/please.js","scripts":{"build":"rollup -c","test":"jest"},"keywords":[],"author":{"name":"Roman Kuba - Codebryo"},"license":"ISC","devDependencies":{"jest":"^26.4.2","rollup":"^2.26.5"},"gitHead":"799f137064de49e4453354d772502b0526e61f76","_id":"@codeb/pleasejs@1.0.0","_nodeVersion":"12.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NuTKpyFZuNSVqxTiDn+4XVF2vNy7+lkLMK3syACRh8qgVr/cJRoX0vOEadw9X3Oi8IE85nKcw3J1h/EFbjXtaQ==","shasum":"12636ee01f392e6d55d4b97d50c2c5d93f955fac","tarball":"https://registry.npmjs.org/@codeb/pleasejs/-/pleasejs-1.0.0.tgz","fileCount":3,"unpackedSize":3680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRhLFCRA9TVsSAnZWagAAM+UQAIkJgCzZ7sZaIqTojenv\nexnA0dIuz1xOw6aP4HnpPMP9XQ73n0Ww06WF2pXgjzyFSBUAHNUKgJ9KLCPD\nNcBVCrDgjgHE0eFfq54+wkuc334EZ3RPVAzOMyt+JPGQrg1kzgaNxhebmT5R\ntc51Whl34xIhCGe9kY7rsBYeTJToP4MH/77uTbHLzmkBJ62dKpVTAA1BG2FS\n5+0BKyNXXVymvzVs1DMWll+z/u/JC/QmqFY4L6Ct/xRaGEWEkjpilvx0j9qS\nWY5SOQMc/cw9n04o6HvAraHOeUFiPf4aYc572mQSOPGj7b3gXrXXCvdgIHHu\n0qnurJP5OP+a5FC7GZ34e/rYXDcuWIp5uAYTF4A2MsT/HxawqXpfVF2wj4P5\nVM3IiBxsKi0QnksamaxqeiPa1JLzS7cyBRKOjWeYv6yM2NqRhatmyEjUDzci\n6sR5p2csJzCaBFcDm62mdvMG2yT+byQ62RWzuXV3TEcdZukEkEzBOcwOUECn\n050FKNJf1+tslYEoYX4l+0ggplGXIqrtgDVSNVZf1qaThePkp06po8hR4+WY\n7on5MXVcP+sHC04PMhw/sEtpI1LloTDcQGO4qC1N3leUuaARVEDGj2hPNFDw\nS3coLyzUbCJLDgbAd5j3IjFtyhwbNlZ4M5h7WLfvO+D5vvDa5+TK0DB9dkp1\n3FHS\r\n=ZuOc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+Rtk0kjZeflg1gTuFo9FjCJSDRSuIPSZ58o/RfZQpnQIhAPPoVHMjhgmyE+FSGvLUn2l9j+ypCCI4idOHLzAj+J17"}]},"maintainers":[{"name":"codebryo","email":"roman.kuba@gmail.com"}],"_npmUser":{"name":"codebryo","email":"roman.kuba@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pleasejs_1.0.0_1598427845425_0.531198191175031"},"_hasShrinkwrap":false},"1.0.1":{"name":"@codeb/pleasejs","version":"1.0.1","description":"🙌 Please.js is the polite way of building a javascript util library for any project.","main":"dist/please.js","scripts":{"build":"rollup -c","test":"jest"},"repository":{"type":"git","url":"git+https://gitlab.com/codebryo/pleasejs.git"},"keywords":[],"author":{"name":"Roman Kuba - Codebryo"},"license":"ISC","devDependencies":{"jest":"^26.4.2","rollup":"^2.26.5"},"gitHead":"8bf52412d493f2370e48c18eeea9abdde6ac0912","bugs":{"url":"https://gitlab.com/codebryo/pleasejs/issues"},"homepage":"https://gitlab.com/codebryo/pleasejs#readme","_id":"@codeb/pleasejs@1.0.1","_nodeVersion":"12.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-aO+Dhz1EzW7vKLNJrD5ixFEPzOL4Gtk5ZP7Ugg4rDz+zVBs668wiZwjG40kJqjInW3+h/0Nd5YlshDGKzHXUaQ==","shasum":"4283cfe7230071a6ef1a0ed414a8e2af2829c05a","tarball":"https://registry.npmjs.org/@codeb/pleasejs/-/pleasejs-1.0.1.tgz","fileCount":3,"unpackedSize":4608,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfRjg8CRA9TVsSAnZWagAAvUcP/3qwQ1TY9u6bK96fiDm3\niBFbNXqqxhuZxDhKdfTo0DULtM4PI1e2xSflFlrl1qahPjn+AV5MgJ+kKN3/\nVS6kAhOuiJZ4GtJXt8oEQguHZLTn1bulTMjuJwH7KVXdWyxHf9fFRgF1wcKz\neybAy7YEITlXQhLm+Z4AZUy6PUplJjj4Y5ebCRDMY0D/rqFsT3oT6AQ7UtOu\nl0SAbAnTTeqljU8lYoBO+Wd9DBububQnWno4i2ixR/x+6QDi8Hvzwlv6HmdB\n176eiCDGbWTFnqZ27a1tCQiF2eqXgX8d7jGDtkQoV3fGO2Ii7piBYnE692HJ\nNSISgTlNmoONt0lPm4qBJAiTkwV+uqLI+QD9uN6Gqu4387IoW3Z2XqIYwv7f\nKr2MSx9iiWEuD31sxuWg0yCd2+vK/g5jhIvCEzuKnqL1zkaTwhII818VqQt3\n+LgigrMuupW2l7PiulraoxJ4SAwKMgCCcfXEZWMse9kkQC1uxKMuuZVHcSEA\n274RfM1Wcp019wLDVtKk1SMu3lcLDjyzMTUD+9EDr51O2FQcOgJkHVfrrYE1\ngTAwNN+dNp/CJe5Q5v6ABMbxSBG4ltONTODcHCb5qYnmkrKQX6IkXCrzNkoC\nc+8t8ohnvOQ1usbVp2J8VR69+R4xnf/AfGtAi7Hp57tdsuNhvSnQdOk1JXQY\nNk1q\r\n=jHU2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAYgabDiIRaTJUivGfzwOMcNAXvRT1GuzE+yedlEKUFwIhAMPEcxNSqMJFEZ3pUfax71RLgeLY5U01tFoBXFa/Ws8g"}]},"maintainers":[{"name":"codebryo","email":"roman.kuba@gmail.com"}],"_npmUser":{"name":"codebryo","email":"roman.kuba@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pleasejs_1.0.1_1598437435896_0.257554828922792"},"_hasShrinkwrap":false}},"time":{"created":"2020-08-26T07:44:05.151Z","1.0.0":"2020-08-26T07:44:05.526Z","modified":"2022-04-04T23:58:51.118Z","1.0.1":"2020-08-26T10:23:55.999Z"},"maintainers":[{"name":"codebryo","email":"roman.kuba@gmail.com"}],"description":"🙌 Please.js is the polite way of building a javascript util library for any project.","keywords":[],"author":{"name":"Roman Kuba - Codebryo"},"license":"ISC","readme":"# 🙌 Please.js\n\n### the polite way of building a javascript util library for your project\n\nDoes this sound familiar?\n\nYou are building some helper functions for your project, you want to eventually combine it under one name... and now you spend hours thinking about what to call your **util library**.\n\n![Yes](https://media.giphy.com/media/WJjLyXCVvro2I/giphy-downsized.gif)\n\nThis is your problem no more.\n\nEnter: **🙌 Please.js**\n\n![Please tell me more Sir!](https://media.giphy.com/media/6kvVGhp7bp2WA/giphy.gif)\n\n**Create a polite API for whatever you want to build.**\n\nYou have a function to move an element from a to b?\nWhat about this API:\n\n```js\n// Politely ask to move something\nplease.move(element);\n```\n\nYou have a function to hide a textbox? What about this API:\n\n```js\n// Politely ask to hide content\nplease.hideTheTextbox('.thisone');\n```\n\nYou have a function to have HBO remake the horrible last season of Game of Thrones? What about this API?\n\n```js\n// Hey HBO, are you listening?\nplease.remakeThatNonsens();\n```\n\nDoesn't that all look like a super polite API?\n\n![Please, I want that now!](https://media.giphy.com/media/nh9k1qzeLf99S/giphy.gif)\n\nLuckily this all can be yours now, so let me show you how!\n\n## Installation and how to use\n\n**Add it to your project**\n\n```shell\nnpm install @codeb/pleasejs\n```\n\nAfter that -- import `please` where your utility functions live.\n\n```js\n// ./please.js\n\nimport Please from '@codeb/pleasejs';\n\n// create your new polite please instance\nconst please = new Please();\n\n//Let's teach it a new method\nplease.learn('sayHello', (name) => {\n  console.log(`Hello ${name}`);\n});\n```\n\nNow this function is made available to you on the please instance.\nYou could call it like this:\n\n```js\nplease.sayHello('Wonder Woman');\n// -> logs 'Hello Wonder Woman'\n```\n\nWhat a polite wayway to add new methods. You can add all the methods you want now. So let's see how to make it available in your project:\n\n**Expose please to my project**\n\nAt the end of your own `please.js` file you just want to export it, so the rest of your project can politely do things.\n\n```js\nexport default please;\n```\n\nImport it and use it!\n\n```js\n// ./some-file.js\n\nimport please from './please.js';\n\nplease.sayHello('Batman');\n```\n\nThat's it.\n\n![Exciting](https://media.giphy.com/media/5GoVLqeAOo6PK/giphy.gif)\n\n### One more thing\n\nThere's one little thing that I would recommend to do though.\n\nAs you've seen it's easy to add new methods to `please`, but this also means you could add new methods wherever you have access to the instance. As this is potentially annoying and might put all the awesome code you want to use in too many places, `please` got your back.\n\n- `learn` will always warn you if you if there already is method defined with that name.\n\n```js\nplease.learn('sayHello', () => {});\n// -> Throws Error 'Method sayHello is already defined'\n```\n\n- Also, you can **freeze your instance** to avoid accidental additions and make sure your codebase is polite AND clean.\n\n```js\n// Prevent adding any new methods by freezing the API into place\nplease.freeze();\n```\n\n### All together\n\nHere's all the code from above put together clean and simple.\n\n```js\nimport Please from '@codeb/pleasejs';\n\nconst please = new Please();\n\nplease.learn('sayHello', (name) => {\n  console.log(`Hello ${name}`);\n});\n\nplease.freeze();\n\nexport default please;\n```\n\nIt was never easier to write a polite utility library.\n\n![Thank you](https://media.giphy.com/media/1uC8xfkZRi7Kw/giphy.gif)\n\n---\n\n**🙌 Please.js** is brought to you by [@codebryo](https://twitter.com/codebryo)\n","readmeFilename":"README.md","homepage":"https://gitlab.com/codebryo/pleasejs#readme","repository":{"type":"git","url":"git+https://gitlab.com/codebryo/pleasejs.git"},"bugs":{"url":"https://gitlab.com/codebryo/pleasejs/issues"}}