Configure TypeScript type definitions for goja_nodejs
masterType definitions for the various modules are published to npm under the @dop251/types-goja_nodejs-MODULE pattern (e.g., @dop251/types-goja_nodejs-buffer).
To use these definitions in a TypeScript project:
- Install the specific module type package via npm.
- Update your
tsconfig.jsonto include the@dop251directory in yourtypeRoots.
Note: Modules are split into separate packages so they can be enabled or disabled individually in your Go environment.
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/@dop251"
]
}
}