Skip to content

Extract any definition from TS definitions file

License

Notifications You must be signed in to change notification settings

codsen/tsd-extract-noesm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Apr 29, 2022
c844ee2 · Apr 29, 2022

History

23 Commits
Apr 6, 2022
Apr 29, 2022
Apr 29, 2022
Apr 29, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022
Apr 11, 2022
Apr 6, 2022
Apr 29, 2022
Apr 6, 2022
Apr 6, 2022
Apr 6, 2022

Repository files navigation

tsd-extract-noesm

Extract any definition from TS definitions file

Install

This program is not pure-ESM. For pure-ESM, use tsd-extract instead. Both have the same API and the same features.

npm i tsd-extract-noesm

Quick Take

import { strict as assert } from "assert";
import { extract } from "tsd-extract-noesm";

const { value } = extract(
  `interface Opts1 { foo: boolean };
interface Opts2 { bar: boolean };`,
  "Opts2"
);

assert.equal(value, "interface Opts2 { bar: boolean };");

Documentation

This is a clone of tsd-extract but in non-ESM configuration.

We needed it because mdx-bundler (as of v9) uses @esbuild-plugins/node-resolve which in turn, uses resolve which does not support ESM packages which have exports pointing to anything else than index.js.

Please visit codsen.com for a full description of the API.

Contributing

To report bugs or request features or assistance, raise an issue on GitHub.

Licence

MIT License

Copyright (c) 2010-2022 Roy Revelt and other contributors

ok codsen star