Install missing TypeScript typings for dependencies in your
npm install -g typesync
You can also use it directly with
npx which will install it for you:
typesync [path/to/package.json] [--dry]
Path is relative to the current working directory. If omitted, defaults to
--dry is specified, will not actually write to the file, it only prints added typings,
typesync only modifies your
package.json - you still need to run
npm install, or — if drinking the k00laid —
TypeSync will add typings for packages that:
- have a
- don't already provide typings internally (the
TypeSync will try to respect semver parity for the code and typings packages, and will fall back to the latest available typings package.
If you use a Semver
~ for a package, the same prefix will be used for the typings package. If you pin to an exact version (
"some-package": "1.2.3"), no prefix will be written.
TypeSync added support for monorepos in v0.4.0. It will look at
workspaces globs in
package.json and sync every matching file in one fell swoop.
Installing typings manually sucks. Flow has
flow-typed which installs type definitions by looking at a
package.json, which would be cool to have for TypeScript. Now we do!
Jeff Hansen - @Jeffijoe