{"_id":"@cristalnaya/chops","name":"@cristalnaya/chops","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@cristalnaya/chops","version":"1.0.0","description":"NPM package that will add a TypeScript method called chops","main":"src/chop.ts","scripts":{"test":"jest"},"repository":{"type":"git","url":"git+https://github.com/cristalnaya/chops.git"},"keywords":["chops"],"author":{"name":"cristalnaya"},"license":"ISC","bugs":{"url":"https://github.com/cristalnaya/chops/issues"},"homepage":"https://github.com/cristalnaya/chops#readme","devDependencies":{"@types/jest":"^29.4.0","@types/node":"^18.11.18","eslint":"^8.32.0","jest":"^29.4.1","prettier":"^2.8.3","ts-jest":"^29.0.5","typescript":"^4.9.4"},"gitHead":"8f3a044ae234aed0f7e2217e31a49a21bf055aec","_id":"@cristalnaya/chops@1.0.0","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-FcWFMh3tRwISQ7wbb/KF6RJGETSCN9eKf9NaK4i6TQfCKpnLrBnUByU8S+dZo2XCgP2ncqMPqrtsBUVdQpGeHg==","shasum":"be37363f904bfa96c9e52a36b4085829e8d744ce","tarball":"https://registry.npmjs.org/@cristalnaya/chops/-/chops-1.0.0.tgz","fileCount":10,"unpackedSize":5652,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGaKzz1qP6M2YVE7CTuprkun9quGmgVsM3z2mw41qoJlAiEAqkmQkz/hE56XY6EbkvvoI7RDbklwqr0CIMqqb6ZawWs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj36xiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdFg//eUfYrbwOGkL+IGHYh2expoX4BEoe/5uCH4lZbV8IF2g+3eQr\r\nF5by9tJIup3RCYqpkg8f9O/rxl6IPK4UEz6s89VvhwpENMRZVD/ERvC0c7bf\r\n6M/1ADz6IHiJ5laAvhFvx5XkPKsBl0xFfvxkucnLDJEg8rtTneVRjxiYKeJU\r\nz4ii6anpvJSEW9RtJn06VnzZTIbYbxukp9DWyq0FxJyFQ0NXoOgdh/qBPE/M\r\n7UOpVc9+mnpjRwN86KZQt5aUA6l01zN78iyM7HcODMGTEkNfi8/n0M5QCH6f\r\nEz0+DjMo63nnisnXJlmnoFxBMTmnTvLoMW45GDGkXAbBS6rMLuZug+CX85QJ\r\nHqmlnWo288z251DADq9/v5km3032H2UfBF5nU4VQWVvWHYfKwyOWyk5K8jDn\r\ntuIetd6ynGjhe3uAyDuvBghn2ymGHg2/VxJhAA6fmbSmqDxAYHE0gZwaTio1\r\nSSvsHDPrUkJd6N8B/+ObxCaZn79JbToN1abKJwT3KUZS7xCVP/gr5yxBlbVK\r\nUcqmDwWSG4URe+rQCAQjluB3oVBmeoVSBcTpVdndbcb+LmggjPsr5ibZ+eHz\r\nEx+7uXze0CTVVv0bx1bovN0D5J32RG5uZlBlamj54qdiVBCbOe2ZTQAsekLH\r\nx4D3M7prDjDxghG/7bPeZ1nqjw39sETfliU=\r\n=jP0o\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"cristalnaya","email":"radostinadimitrova@gmail.com"},"directories":{},"maintainers":[{"name":"cristalnaya","email":"radostinadimitrova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chops_1.0.0_1675603041839_0.5519929660341119"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-05T13:17:21.784Z","1.0.0":"2023-02-05T13:17:22.018Z","modified":"2023-02-05T13:17:22.194Z"},"maintainers":[{"name":"cristalnaya","email":"radostinadimitrova@gmail.com"}],"description":"NPM package that will add a TypeScript method called chops","homepage":"https://github.com/cristalnaya/chops#readme","keywords":["chops"],"repository":{"type":"git","url":"git+https://github.com/cristalnaya/chops.git"},"author":{"name":"cristalnaya"},"bugs":{"url":"https://github.com/cristalnaya/chops/issues"},"license":"ISC","readme":"# Introduction\n\nThe `chop` method is a TypeScript method that accepts two parameters: `template` and `dataset`. The method is designed to render `template`, replacing `{{x}}` with `data[x]`, and return the resulting string.\n\n# Requirements\n* The `dataset` parameter only accepts objects.\n* The `template` parameter must only accept strings.\n* Both parameters are mandatory. If the method `chop` is called but missing one of the parameters, and error with \"template and dataset are mandatory parameters\" is returned.\n* The `dataset` should only support & number values. If other types are provided, a useful error is given.\n\n# Usage\n\nTo use the `chop` method, simply import it and provide the `template` and `dataset` parameters, then call the method:\n\n```js\nimport {chop} from '@cristalnaya/chops/src/chop';\n\nconst dataset = {\n    bread: 'baguette',\n    cheese: 'brie cheese',\n}\nconst template = 'I like to eat {{bread}} and {{cheese}}';\n\nchop(template, dataset);\n```\n\n# Testing\n\nThe method `chop` has been tested using Jest. To run the tests, simply run the following command in your terminal:\n\n```bash\nnpm run test\n```\n\n# Tools used\n\n* TypeScript\n* Jest\n* ts-jest\n* prettier\n* @types/jest\n* @types/node\n* eslint\n* GitHub Actions","readmeFilename":"README.md"}