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

0.8.17 • Public • Published

tsd-extract

Extract any definition from TS definitions file string

page on codsen.com page on npm page on github Downloads per month changelog MIT Licence

Install

This package is pure ESM. If you're not ready yet, use a non-ESM alternative, tsd-extract-noesm.

npm i tsd-extract

Quick Take

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

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

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

Documentation

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 © 2010-2024 Roy Revelt and other contributors.

ok codsen star

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i tsd-extract

    Weekly Downloads

    1

    Version

    0.8.17

    License

    MIT

    Unpacked Size

    30.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • royston