tsd-extract-noesm
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

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

/tsd-extract-noesm/

    Package Sidebar

    Install

    npm i tsd-extract-noesm

    Weekly Downloads

    4

    Version

    0.6.0

    License

    MIT

    Unpacked Size

    18.5 kB

    Total Files

    8

    Last publish

    Collaborators

    • royston