{"_id":"micromark-factory-space","_rev":"267308","name":"micromark-factory-space","description":"micromark factory to parse markdown space (found in lots of places)","dist-tags":{"latest":"1.0.0","next":"1.0.0-beta.1"},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"time":{"modified":"2023-03-27T19:09:06.000Z","created":"2021-06-07T09:25:57.313Z","1.0.0":"2021-06-22T19:03:38.533Z","1.0.0-beta.1":"2021-06-20T12:12:54.328Z","1.0.0-alpha.3":"2021-06-16T17:18:02.641Z","1.0.0-alpha.2":"2021-06-07T13:35:38.307Z","1.0.0-alpha.1":"2021-06-07T09:25:57.313Z"},"users":{},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"versions":{"1.0.0":{"name":"micromark-factory-space","version":"1.0.0","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0","micromark-util-types":"^1.0.0"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"cebff49968f2b9616c0fcb239e96685cb9497633","size":2604,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/micromark-factory-space/download/micromark-factory-space-1.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0_1624388618384_0.5069487992235473"},"_hasShrinkwrap":false,"publish_time":1624388618533,"_cnpm_publish_time":1624388618533,"_cnpmcore_publish_time":"2021-12-14T05:34:21.788Z"},"1.0.0-beta.1":{"name":"micromark-factory-space","version":"1.0.0-beta.1","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0-beta.1","micromark-util-types":"1.0.0-beta.1"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0-beta.1","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"shasum":"eb976f155edcdfdc979491f330827bac8edc592d","size":2609,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0-beta.1.tgz","tarball":"http://name.csiicloud.com:7001/micromark-factory-space/download/micromark-factory-space-1.0.0-beta.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0-beta.1_1624191174160_0.05456331828686478"},"_hasShrinkwrap":false,"publish_time":1624191174328,"_cnpm_publish_time":1624191174328,"_cnpmcore_publish_time":"2021-12-14T05:34:22.005Z"},"1.0.0-alpha.3":{"name":"micromark-factory-space","version":"1.0.0-alpha.3","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0-alpha.3","micromark-util-types":"1.0.0-alpha.3"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0-alpha.3","_nodeVersion":"16.2.0","_npmVersion":"7.16.0","dist":{"shasum":"4d34b7e759ab1266b4db152ea56886f8a95a87b0","size":2610,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0-alpha.3.tgz","tarball":"http://name.csiicloud.com:7001/micromark-factory-space/download/micromark-factory-space-1.0.0-alpha.3.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0-alpha.3_1623863882494_0.7158164527583084"},"_hasShrinkwrap":false,"publish_time":1623863882641,"_cnpm_publish_time":1623863882641,"_cnpmcore_publish_time":"2021-12-14T05:34:22.194Z"},"1.0.0-alpha.2":{"name":"micromark-factory-space","version":"1.0.0-alpha.2","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0-alpha.2","micromark-util-types":"1.0.0-alpha.2"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"readmeFilename":"readme.md","homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0-alpha.2","_nodeVersion":"16.2.0","_npmVersion":"7.15.1","dist":{"shasum":"a7c41b5036ea818e5a9eee7a364e5138fb5dc64a","size":2610,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0-alpha.2.tgz","tarball":"http://name.csiicloud.com:7001/micromark-factory-space/download/micromark-factory-space-1.0.0-alpha.2.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0-alpha.2_1623072938166_0.5485848812988816"},"_hasShrinkwrap":false,"publish_time":1623072938307,"_cnpm_publish_time":1623072938307,"_cnpmcore_publish_time":"2021-12-14T05:34:22.402Z"},"1.0.0-alpha.1":{"name":"micromark-factory-space","version":"1.0.0-alpha.1","description":"micromark factory to parse markdown space (found in lots of places)","license":"MIT","keywords":["micromark","factory","space"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark.git#main"},"bugs":{"url":"https://github.com/micromark/micromark/issues"},"funding":[{"type":"GitHub Sponsors","url":"https://github.com/sponsors/unifiedjs"},{"type":"OpenCollective","url":"https://opencollective.com/unified"}],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"type":"module","main":"index.js","types":"dev/index.d.ts","exports":{"development":"./dev/index.js","default":"./index.js"},"dependencies":{"micromark-util-character":"^1.0.0-alpha.1","micromark-util-types":"1.0.0-alpha.1"},"scripts":{"build":"rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"homepage":"https://github.com/micromark/micromark/tree/main#readme","_id":"micromark-factory-space@1.0.0-alpha.1","_nodeVersion":"16.2.0","_npmVersion":"7.15.1","dist":{"shasum":"f44116f2a495808315c5b4f9b1688c7b45aa5a0b","size":2603,"noattachment":false,"key":"/micromark-factory-space/-/micromark-factory-space-1.0.0-alpha.1.tgz","tarball":"http://name.csiicloud.com:7001/micromark-factory-space/download/micromark-factory-space-1.0.0-alpha.1.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"npm:wooorm","email":""},{"name":"wooorm","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-factory-space_1.0.0-alpha.1_1623057957164_0.5800578922986728"},"_hasShrinkwrap":false,"publish_time":1623057957313,"_cnpm_publish_time":1623057957313,"_cnpmcore_publish_time":"2021-12-14T05:34:22.638Z"}},"readme":"# micromark-factory-space\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][bundle-size-badge]][bundle-size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\nmicromark factory to parse [markdown space][markdown-space] (found in lots of\nplaces).\n\n## Contents\n\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`factorySpace(…)`](#factoryspace)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## Install\n\n[npm][]:\n\n```sh\nnpm install micromark-factory-space\n```\n\n## Use\n\n```js\nimport {factorySpace} from 'micromark-factory-space'\nimport {codes} from 'micromark-util-symbol/codes'\nimport {types} from 'micromark-util-symbol/types'\n\n// A micromark tokenizer that uses the factory:\n/** @type {Tokenizer} */\nfunction tokenizeCodeFenced(effects, ok, nok) {\n  return start\n\n  // …\n\n  /** @type {State} */\n  function info(code) {\n    if (code === codes.eof || markdownLineEndingOrSpace(code)) {\n      effects.exit(types.chunkString)\n      effects.exit(types.codeFencedFenceInfo)\n      return factorySpace(effects, infoAfter, types.whitespace)(code)\n    }\n\n    if (code === codes.graveAccent && code === marker) return nok(code)\n    effects.consume(code)\n    return info\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the following identifiers: `factorySpace`.\nThere is no default export.\n\n### `factorySpace(…)`\n\nNote that there is no `nok` parameter:\n\n*   spaces in markdown are often optional, in which case this factory can be\n    used and `ok` will be switched to whether spaces were found or not,\n*   One space character can be detected with\n    [markdownSpace(code)][markdown-space] right before using `factorySpace`\n\n###### Parameters\n\n*   `effects` (`Effects`) — Context\n*   `ok` (`State`) — State switched to when successful\n*   `type` (`string`) — Token type for whole (`' \\t'`)\n*   `max` (`number`, default: `Infinity`) — Max size of whitespace\n\n###### Returns\n\n`State`.\n\n###### Examples\n\nWhere `␉` represents a tab (plus how much it expands) and `␠` represents a\nsingle space.\n\n```markdown\n␉\n␠␠␠␠\n␉␠\n```\n\n## Security\n\nSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to\nsubmit a security report.\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`micromark/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organisation, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-space.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-factory-space\n\n[bundle-size-badge]: https://img.shields.io/bundlephobia/minzip/micromark-factory-space.svg\n\n[bundle-size]: https://bundlephobia.com/result?p=micromark-factory-space\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[opencollective]: https://opencollective.com/unified\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[license]: https://github.com/micromark/micromark/blob/main/license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/micromark/.github\n\n[securitymd]: https://github.com/micromark/.github/blob/HEAD/security.md\n\n[contributing]: https://github.com/micromark/.github/blob/HEAD/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/HEAD/support.md\n\n[coc]: https://github.com/micromark/.github/blob/HEAD/code-of-conduct.md\n\n[markdown-space]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character#markdownspacecode\n","_attachments":{},"homepage":"https://github.com/micromark/micromark/tree/main#readme","bugs":{"url":"https://github.com/micromark/micromark/issues"},"license":"MIT"}