{"name":"micromark-factory-mdx-expression","version":"2.0.1","keywords":["micromark","factory","mdx","expression"],"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","_id":"micromark-factory-mdx-expression@2.0.1","maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://github.com/micromark/micromark-extension-mdx-expression/tree/main#readme","bugs":{"url":"https://github.com/micromark/micromark-extension-mdx-expression/issues"},"xo":false,"dist":{"shasum":"f2a9724ce174f1751173beb2c1f88062d3373b1b","tarball":"http://registry-npm.ywwl.com/micromark-factory-mdx-expression/download/micromark-factory-mdx-expression-2.0.1.tgz","fileCount":6,"integrity":"sha512-F0ccWIUHRLRrYp5TC9ZYXmZo+p2AM13ggbsW4T0b5CRKP8KHVRB8t4pwtBgTxtjRmwrK0Irwm7vs2JOZabHZfg==","signatures":[{"sig":"MEYCIQCn862xmngtPB6bNPD6Xzkn/4FIq5mlE82eZjFv8RcrXAIhAOuYCsW/LjwzfbCCYJUKFEAUt391tjsNxJIGxfkTcbFd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32980,"size":6028,"noattachment":false,"key":"/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.1.tgz"},"type":"module","types":"./index.d.ts","exports":{"default":"./index.js","development":"./dev/index.js"},"funding":[{"url":"https://github.com/sponsors/unifiedjs","type":"GitHub Sponsors"},{"url":"https://opencollective.com/unified","type":"OpenCollective"}],"gitHead":"11ce6fb62743515e7af7015e852cc9e96f51152f","scripts":{"build":"micromark-build"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"repository":{"url":"git+https://github.com/micromark/micromark-extension-mdx-expression.git#main","type":"git"},"_npmVersion":"9.7.2","description":"micromark factory to parse MDX expressions (found in JSX attributes, flow, text)","directories":{},"sideEffects":false,"_nodeVersion":"20.0.0","dependencies":{"devlop":"^1.0.0","@types/estree":"^1.0.0","vfile-message":"^4.0.0","micromark-util-types":"^2.0.0","micromark-util-symbol":"^2.0.0","micromark-util-character":"^2.0.0","micromark-util-events-to-acorn":"^2.0.0","unist-util-position-from-estree":"^2.0.0"},"typeCoverage":{"detail":true,"strict":true,"atLeast":100,"ignoreCatch":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/micromark-factory-mdx-expression_2.0.1_1688744316415_0.07786107863913605","host":"s3://npm-registry-packages"},"readme":"# micromark-factory-mdx-expression\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][opencollective]\n[![Backers][backers-badge]][opencollective]\n[![Chat][chat-badge]][chat]\n\n[micromark][] factory to parse MDX expressions (found in JSX attributes, flow,\ntext).\n\n## Contents\n\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`factoryMdxExpression(…)`](#factorymdxexpression)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-factory-mdx-expression\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {factoryMdxExpression} from 'https://esm.sh/micromark-factory-mdx-expression@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {factoryMdxExpression} from 'https://esm.sh/micromark-factory-mdx-expression@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {ok as assert} from 'devlop'\nimport {factoryMdxExpression} from 'micromark-factory-mdx-expression'\nimport {codes} from 'micromark-util-symbol'\n\n// A micromark tokenizer that uses the factory:\n/** @type {Tokenizer} */\nfunction tokenizeFlowExpression(effects, ok, nok) {\n  return start\n\n  // …\n\n  /** @type {State} */\n  function start(code) {\n    assert(code === codes.leftCurlyBrace, 'expected `{`')\n    return factoryMdxExpression.call(\n      self,\n      effects,\n      factorySpace(effects, after, types.whitespace),\n      'mdxFlowExpression',\n      'mdxFlowExpressionMarker',\n      'mdxFlowExpressionChunk',\n      acorn,\n      acornOptions,\n      addResult,\n      spread,\n      allowEmpty\n    )(code)\n  }\n\n  // …\n}\n```\n\n## API\n\nThis module exports the identifier\n[`factoryMdxExpression`][api-factory-mdx-expression].\nThere is no default export.\n\nThe export map supports the [`development` condition][development].\nRun `node --conditions development module.js` to get instrumented dev code.\nWithout this condition, production code is loaded.\n\n### `factoryMdxExpression(…)`\n\n###### Parameters\n\n* `effects` (`Effects`)\n  — context\n* `ok` (`State`)\n  — state switched to when successful\n* `type` (`string`)\n  — token type for whole (`{}`)\n* `markerType` (`string`)\n  — token type for the markers (`{`, `}`)\n* `chunkType` (`string`)\n  — token type for the value (`1`)\n* `acorn` (`Acorn`)\n  — object with `acorn.parse` and `acorn.parseExpressionAt`\n* `acornOptions` ([`AcornOptions`][acorn-options])\n  — configuration for acorn\n* `boolean` (`addResult`, default: `false`)\n  — add `estree` to token\n* `boolean` (`spread`, default: `false`)\n  — support a spread (`{...a}`) only\n* `boolean` (`allowEmpty`, default: `false`)\n  — support an empty expression\n* `boolean` (`allowLazy`, default: `false`)\n  — support lazy continuation of an expression\n\n###### Returns\n\n`State`.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional types [`Acorn`][acorn] and\n[`AcornOptions`][acorn-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line,\n`micromark-factory-mdx-expression@^2`, compatible with Node.js 16.\n\nThis package works with `micromark` version `3` and later.\n\n## Security\n\nThis package is safe.\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[acorn]: https://github.com/acornjs/acorn\n\n[acorn-options]: https://github.com/acornjs/acorn/blob/96c721dbf89d0ccc3a8c7f39e69ef2a6a3c04dfa/acorn/dist/acorn.d.ts#L16\n\n[api-factory-mdx-expression]: #micromark-factory-mdx-expression\n\n[author]: https://wooorm.com\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[build]: https://github.com/micromark/micromark-extension-mdx-expression/actions\n\n[build-badge]: https://github.com/micromark/micromark-extension-mdx-expression/workflows/main/badge.svg\n\n[chat]: https://github.com/micromark/micromark/discussions\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[coverage]: https://codecov.io/github/micromark/micromark-extension-mdx-expression\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-mdx-expression.svg\n\n[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions\n\n[downloads]: https://www.npmjs.com/package/micromark-factory-mdx-expression\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-mdx-expression.svg\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/micromark/.github\n\n[license]: https://github.com/micromark/micromark-extension-mdx-expression/blob/main/license\n\n[micromark]: https://github.com/micromark/micromark\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[opencollective]: https://opencollective.com/unified\n\n[size]: https://bundlejs.com/?q=micromark-factory-mdx-expression\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-mdx-expression\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[typescript]: https://www.typescriptlang.org\n","publish_time":1688744316570,"_cnpm_publish_time":1688744316570,"dist-tags":{"latest":"2.0.3","next":"1.0.0-alpha.1"}}