0.6.0 • Published 4 years ago
tsd-extract-noesm v0.6.0
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-noesmQuick 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