indefinitely-typed is a utility designed to manage pre-release or experimental TypeScript declaration files, offering a flexible alternative to the more stringent publishing process of DefinitelyTyped. Currently at version 1.1.0, this package provides a mechanism to locally install and make custom type definitions available by copying specified folders into the `node_modules/@types/` directory of a consuming project. This allows developers to iterate quickly on type definitions, support custom versioning, or publish types on demand without waiting for the `types-publisher` process. Its primary use case is for types that are 'hatching' – incomplete, lacking comprehensive tests, or requiring a rapid deployment cycle not typically supported by the official `@types` ecosystem. It is primarily invoked as a `postinstall` script, making the types immediately available upon package installation.
npm install indefinitely-typedVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a typings package using `indefinitely-typed` and consume it in another project, making custom type declarations available via a `postinstall` script.
Exercise caution when installing packages that utilize `postinstall` scripts, especially from untrusted sources, as they can execute arbitrary code on your system. Always review the `postinstall` script in `package.json` before installation if you are unsure about the package's origin.
`indefinitely-typed` is designed for 'hatching' types. For stable, well-tested, and widely used type definitions, contribute to or consume from DefinitelyTyped (`@types/`). This tool bypasses the quality assurance processes of DefinitelyTyped.
Ensure that the type package name (`my-awesome-lib` in the example) does not conflict with existing `@types/` packages or official type declarations shipped directly with a library. `indefinitely-typed` will copy its declarations into `node_modules/@types/`, potentially shadowing or overwriting others.
Ensure your `tsconfig.json` does not explicitly exclude `node_modules/@types` or use `typeRoots` in a way that prevents discovery. The default TypeScript module resolution usually finds types in this location, but custom configurations can interfere.
Ensure `indefinitely-typed` is listed in `devDependencies` or `dependencies` in the `package.json` where the `postinstall` script is defined, and that `npm install` has been run to link the executable.
Verify that the `--folder` argument in the `postinstall` script exactly matches the name of the package you're providing types for (e.g., `my-awesome-lib`). Check `tsconfig.json` for `typeRoots` or `types` configurations. Try deleting `node_modules` and `package-lock.json` (or `yarn.lock`), then run `npm install` again.
No dependency data recorded yet.