Skip to content

Resolve All Typescript Definition Files of npm Packages

Notifications You must be signed in to change notification settings

ttys026/typings-resolver

Repository files navigation

typings-resolver


A lib to recursively resolve all typings files of a package. Works both in browser and in node environment.

demo

Install

npm i typings-resolver

Usage

await resolve done

import { Resolver } from "typings-resolver";

const resolver = new Resolver();
await resolver.addPackage({ name: "react" });
const files = resolver.getFiles();
console.log("files", files);

use EventEmitter

import { Resolver } from "typings-resolver";

const resolver = new Resolver();
resolver.emitter.on("add", console.log);
resolver.emitter.on("done", () => {
  const files = resolver.getFiles();
  console.log("files", files);
});
resolver.addPackage({ name: "react" });

About

Resolve All Typescript Definition Files of npm Packages

Resources

Stars

Watchers

Forks