0.2.1 • Published 7 years ago

types-local v0.2.1

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

npm version CircleCI

types-local: A TypeScript Definition Helper for not type-defined package in DefinitelyTyped to use easily

types-local is a tool that generates TypeScript definition file (.d.ts) from node package.

types-local uses dts-gen, generates module at types-local/<module-name> and install folder as package.

Usage

> npm install -g types-local

# install not type-defined package
> npm install --save <module-name>, <module-name2>, ...
> types-local install <module-name>, <module-name2>, ...

This generates

.
+-- types-local
   +-- <module-name>
       +-- package.json
       +-- index.d.ts (type definition)
   +-- <module-name2>
       +-- package.json
       +-- index.d.ts (type definition)
   ...

And update tsconfig.json

{
    "compilerOptions": {
        "baseUrl": ".", // if not exists
        "paths": { // add module path
            "${moduleName}": [
                "types-local/${moduleName}"
            ],
            "${moduleName2}": [
                "types-local/${moduleName2}"
            ],
            ...
        }
    }
}
# if you want to uninstall definition
> types-local uninstall <module-name>, <module-name2>, ...

will remove types-local/<module-name>, types-local/<module-name2>, ... and update tsconfig.json.

Command Options

shorthandfulldescription
-v--versionShow version
-h--helpShow help

types-local.json

types-local.json allows you to customize types-local behavior.

> types-local init

creates types-local.json with default setting.

Options

nametypedefaultdescription
installDirstringtypes-localtypes definition location directory

Module Resolution

Currently find node_modules directory from current directory to root directory. If node_modules/${moduleName}/package.json is found, requires node_modules/${moduleName}. If not found, require(${moduleName}) calls.

0.2.1

7 years ago

0.2.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago