Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maddhruv/types-sync
Sync your types :wink:
https://github.com/maddhruv/types-sync
definitelytyped nodejs npm types typescript yarn
Last synced: 2 months ago
JSON representation
Sync your types :wink:
- Host: GitHub
- URL: https://github.com/maddhruv/types-sync
- Owner: maddhruv
- License: mit
- Created: 2021-05-02T12:00:53.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T00:33:00.000Z (about 1 year ago)
- Last Synced: 2024-11-04T01:32:52.762Z (3 months ago)
- Topics: definitelytyped, nodejs, npm, types, typescript, yarn
- Language: TypeScript
- Homepage:
- Size: 9.47 MB
- Stars: 24
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# types-sync
Keep your types in sync with DefinitelyTyped - auto install/uninstall types for dependencies on
postinstall.[![npm version](https://badge.fury.io/js/types-sync.svg)](https://www.npmjs.com/package/types-sync)
## Features
- Works with `npm`, `yarn`, `pnpm`, `bolt`
- In sync with [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)
- Can be hooked with npm and husky hooks## Install
`npm install -D types-sync`
## Usage
### As CLI
Use `types-sync` as `postinstall` scripts in your _package.json_
```js
"scripts": {
"postinstall": "types-sync",
}
```### As Module
```ts
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](https://github.com/maddhruv/types-sync/blob/master/.types-syncrc.json) for
full config## Related
- Uses [types-directory](https://github.com/maddhruv/types-directory) under the hood to fetch all
available types