types-sync

Keep your types in sync with DefinitelyTyped - auto install/uninstall types for dependencies on postinstall.

Stats

StarsIssuesVersionUpdatedCreatedSize
types-sync
1702.1.07 months ago7 months agoMinified + gzip package size for types-sync in KB

Readme

types-sync

Keep your types in sync with DefinitelyTyped - auto install/uninstall types for dependencies on postinstall.

npm version CI

Features

  • Works with npm, yarn, pnpm, bolt
  • In sync with DefinitelyTyped
  • Can be hooked with npm and husky hooks

Install

npm install -D types-sync

Usage

As CLI

Use types-sync as prepare or prebuild scripts in your package.json

"scripts": {
  "prepare": "types-sync",
}

Note: use types-sync as the prepare script so that it only runs in the local environment.

As Module

import typesSync from 'types-sync';

const types = typesSync({
  dependencies,
  devDependencies,
  ignore,
});

Config

Add a .types-syncrc.json at the root of your project.

options type description
dependencies Array dependencies to manually add for sync
ignore Array ignore these dependencies from removing
packageManager npm/yarn/pnpm/bolt package manager to use
removeUnused Boolean remove unsued types

Note: types-sync will automatically detect the package manager being used according to the lock files. Explicitly defining the packageManager config option is optional and if defined will force types-sync to use the specified package manager.

Refer to ./types-syncrc.json for full config

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.