{"_id":"@camwiegert/typical","_rev":"2-c693c8571478bdf228c87a74b7e30535","name":"@camwiegert/typical","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@camwiegert/typical","version":"0.1.0","description":"Animated typing in ~400 bytes","scripts":{"test":"node -r esm test"},"main":"typical.js","author":{"name":"Cam Wiegert","email":"cam@camwiegert.com"},"homepage":"https://github.com/camwiegert/typical","repository":{"type":"git","url":"git+https://github.com/camwiegert/typical.git"},"license":"MIT","devDependencies":{"esm":"^3.2.25","tape":"^4.11.0"},"gitHead":"461a32ed3cf38da336203842d22668a7dc5cdd1c","bugs":{"url":"https://github.com/camwiegert/typical/issues"},"_id":"@camwiegert/typical@0.1.0","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-U74Q3xqCIUGy5azDcny30/uhkAwGpMZ0fny9yB14ljJduYpYQAsRMMDoRgRHfGiHcBxv8a8sIZ1N+N78ItJqZQ==","shasum":"5aafe9a8bb3f282df5d1e1ef31c74e4ebf5f0248","tarball":"https://registry.npmjs.org/@camwiegert/typical/-/typical-0.1.0.tgz","fileCount":6,"unpackedSize":8754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdpSlfCRA9TVsSAnZWagAAizYP/jaCw9sO+mv/XkylYPW/\nTyuue1UY7r9ivVJOh6/5t/f0icQL8hZv11wZtLpcKCben0C5UzepRrE4caRc\n4Jb3Q1oPq7x7dHGHS3e+7YvQMRmc7Bah4l2ZJCSHqeClSBUvImEn4jYGJM4k\nYvbNMzexSM83MTftiKcgZXmTbjX5Rj1tlf+YZQJswGgun2wSf1nxKVnyOjKh\nEpRKCyP7LXBRDe/Fc+vdZWGJKLerJ6nvHUvc+n7JX5jNcsZGNE22slPXailz\nJwdbLlnuQP4SvtTDaSm6NKjNppYfrKWyEgcj9tU25TbFHhdy/JY4d2C3uLHk\ngKLmn3OXxlvloRNc55aGPxJxFf8VBQ/gtQErXkwEJAcz6RoS/Gn6vYGWDjPp\nzh7SmqztoJTqEmZYPGRCzgi8hCqdFFlOJRG/MVU7R6R6pSj84ISEK0+xutvN\nkhGWfx+ZZFyPpRRLCbhVB1U5tFU2FrDev64x8UWr3LQNAE1cI3CxcXAgkwkp\niCeq1ohDRCKyXoUC0L6dacj6AoXOpqMPvAaMpvpQfn3bhK5U6Cu7CsyKL9tZ\nca/1in9ESM1yxeSfGMH4+wv4BxBf11HQQ6L4PNNCOgxcT8RDdVddt8z6T/xs\ns7mGOWrQrD1HvapqTPdis6ljTaTxhwsigD5AORIDGxXyY1WOM30mJwyJ3D5G\njZle\r\n=1lfa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD31mRiDrUkXSUn2oy13fXuprYbJiUajN5Sbyw5HBBYvQIhAJmD8T/sWFyxEfZLzDRKtr6Ceg33Ot07JX36FLCkSn+J"}]},"maintainers":[{"name":"camwiegert","email":"cam@camwiegert.com"}],"_npmUser":{"name":"camwiegert","email":"cam@camwiegert.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typical_0.1.0_1571105119150_0.9070550449639163"},"_hasShrinkwrap":false},"0.1.1":{"name":"@camwiegert/typical","version":"0.1.1","description":"Animated typing in ~400 bytes","scripts":{"test":"node -r esm test"},"main":"typical.js","author":{"name":"Cam Wiegert","email":"cam@camwiegert.com"},"homepage":"https://github.com/camwiegert/typical","repository":{"type":"git","url":"git+https://github.com/camwiegert/typical.git"},"license":"MIT","devDependencies":{"esm":"^3.2.25","tape":"^4.11.0"},"gitHead":"0ad4c0ef9c93247dca36e463f33c02100e5b5522","bugs":{"url":"https://github.com/camwiegert/typical/issues"},"_id":"@camwiegert/typical@0.1.1","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-4xAtH3F3uJ8boe9IPahdYFCBELmyOBwHGAn0rDO6C1rx0TuZb5f4UqfuiOQF7YiMJGCOsUIW7LyucMNnVQYsRg==","shasum":"c75d3b658e2f542d113c3e266389794c7dc45d6d","tarball":"https://registry.npmjs.org/@camwiegert/typical/-/typical-0.1.1.tgz","fileCount":5,"unpackedSize":8553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdq2TSCRA9TVsSAnZWagAAmSAP/Re869t81sywccPxveAO\n0YspCJivXmc18XtIBMHUVbh66aiXSMZGj6zV82lg9tLAfi5zVH0tAxTRzYDM\nFGU3F5l7zvq9RJnluJsyfSSANJJ5OdczWUb3qM9g8/0qJzRJvTTW5pbzWDl3\nwv5iicLtAlVAZav/Tq0ahUDQ5C6yTEIUK3Uos0R8/hlvaOCsV5gz3dvkV7fR\nt+LvrROjuvR0d6BVzDdC7+LSuThQfUx3xlB5qmkPKrijFr4CcPZ/jwgaQgaI\nCltXAuvxocouND5JyKgwSRKuO51dJzQmU+RELurXplQX5zRibXb190D2l8mh\nnEqkpqI55twIlLy6FDK/2oywQDXavbpAQgIEYdJOTAQOLe0GN/icX/eqe/uy\nhwrXn1c1Jzi85FrbL+19mwTNORgaWEy2sl9JqTPSiWmFCEhG4b8zVs29RZHL\nDbliYM+Yag+b2Z2KVzNxBztCeynwoyktdsbYFA29Pdwt91aOIK5PmGzs6R8y\nwNlLFbYC+81d7OZes9vbdre64E/cMeSf5E7lKEWJhIpQVeQY77qghcWKHk6J\n5wMJFa90F//YGXpUGxyQkQnxndaMkYl25vrlDaspjyoTm0Mm340Jm4XdD6Lg\nn6HbstS3szys0hYmWg8EmkaDSEU8EFGJvU6XrbjTq6HaCple07TpHTWmZ52d\naDGs\r\n=rglg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFOklFaU3ZO8Rz9Sm5H5WK1uP9PAaHJnUCXM/viHJatwIgCT2kBmPUBnYtEl1sKSwlEnNLCYYOmkUvyo+OITWarL8="}]},"maintainers":[{"name":"camwiegert","email":"cam@camwiegert.com"}],"_npmUser":{"name":"camwiegert","email":"cam@camwiegert.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/typical_0.1.1_1571513553446_0.7458552805655596"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-15T02:05:18.930Z","0.1.0":"2019-10-15T02:05:19.268Z","modified":"2022-04-04T21:35:32.944Z","0.1.1":"2019-10-19T19:32:33.601Z"},"maintainers":[{"name":"camwiegert","email":"cam@camwiegert.com"}],"description":"Animated typing in ~400 bytes","homepage":"https://github.com/camwiegert/typical","repository":{"type":"git","url":"git+https://github.com/camwiegert/typical.git"},"author":{"name":"Cam Wiegert","email":"cam@camwiegert.com"},"bugs":{"url":"https://github.com/camwiegert/typical/issues"},"license":"MIT","readme":"# typical\n\n> Animated typing in ~400 bytes :blowfish: of JavaScript.\n\n- **Zero dependencies**\n- **MIT licensed** [→](https://github.com/camwiegert/typical/tree/master/LICENSE)\n- **Emoji support**\n- **Smart delete:** only delete what needs deleting\n- **Pausing:** pause between steps\n- **Looping:** easily loop from any point\n- **Waiting:** wait on arbitrary Promises\n- **Humanity:** slightly varied typing speed\n\n[**Demo →**](https://codepen.io/camwiegert/pen/rNNepYo)\n\n---\n\n## Install\n\n```shell\nnpm install @camwiegert/typical\n```\n\n<details>\n  <summary><strong>More install options</strong></summary>\n  <p>Instead of using a package manager, you can download <code>typical.js</code> from <a href=\"https://raw.githubusercontent.com/camwiegert/typical/master/typical.js\">GitHub</a> and import it locally or import it directly from a CDN like <a href=\"https://unpkg.com/@camwiegert/typical\">unpkg</a>.</p>\n</details>\n\n## API\n\n```typescript\ntype(target: HTMLElement, ...steps: any[]) => Promise<void>;\n```\n\nThe module exports a single function, `type`, which takes a target element as its first argument, and any number of additional arguments as the steps to perform. Additional arguments perform actions based on their type:\n\n- `string` arguments will be typed\n- `number` arguments will pause, in milliseconds\n- `function` arguments will be called with the target element as an argument\n- `Promise` arguments will wait for resolution\n\n## Usage\n\nThe most basic usage of `type` is providing a target element and a string to type.\n\n```javascript\nimport { type } from '@camwiegert/typical';\n\ntype(element, 'text');\n```\n\n### Pausing\n\nIn order to pause typing at any point, pass a number of milliseconds to pause.\n\n```javascript\ntype(element, 'Hello', 1000, 'Hello world!');\n```\n\n### Looping\n\nIn order to loop, pass `type` as a parameter to itself at the point at which you'd like to start looping. It can be helpful to alias `type` as `loop` to be explicit.\n\n```javascript\nimport {\n    type,\n    type as loop\n};\n\nconst steps = [1000, 'Ready', 1000, 'Set', 1000, 'Go'];\n\ntype(element, ...steps, loop);\n```\n\nTo loop a finite amount, pass your steps multiple times.\n\n```javascript\ntype(element, ...steps, ...steps, ...steps);\n```\n\n### Waiting\n\nWhen passed a `Promise`, `type` will wait for it to resolve before continuing. Because `type` itself returns a `Promise`, that means you can wait on a set of steps to complete before starting another.\n\n```javascript\nconst init = type(target, 'In a moment...', 500);\n\ntype(target, init, 'start', 500, 'looping', loop);\n```\n\n### Functions\n\nFunction arguments are passed the target element, and can be useful for operating on the target element between steps. If you return a `Promise`, `type` will wait for it to resolve.\n\n```javascript\nconst toggle = (element) =>\n    element.classList.toggle('is-typing');\n\ntype(target, toggle, 'Type me', toggle);\n```\n\n## Support\n\n- [x] Chrome\n- [x] Edge\n- [x] Firefox\n- [x] Safari\n- [ ] Internet Explorer\n","readmeFilename":"readme.md"}