
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Generates concatenated .d.ts
file(s) for the TypeScript project.
Usage:
dts-pack --entry <entry-name> --module <module-name> [<options...>]
dts-pack --list [<options...>]
Options:
--help, -h, -? Show help [boolean]
--project, -p The project file or directory
[string] [default: "./tsconfig.json"]
--entry, -e The entry module name in the project [string]
--moduleName, -m The output module name [string]
--export, -x The export entity name in the entry module name [string]
--rootName, -r The root variable name [string]
--outDir, -o The output directory name (not file name)
[string] [default: "./"]
--style, -s The declaration style
[string] [choices: "module", "namespace"] [default: "module"]
--defaultName, -d The 'default' name for namespace-style
[string] [default: "_default"]
--importBindingName The identifier for binding modules with 'import'
[string] [default: "__module"]
--list If specified, outputs all imports and exports and exit
without emitting files. [boolean]
--version, -v Show version number [boolean]
Shows the usage.
Specifies the TypeScript project file (such as tsconfig.json) or the directory path.
If omitted, './tsconfig.json'
will be used.
Specifies the entry module name to expose exported entities. This is treated as a source name of the project, so the name must be the relative path name from the root source directory.
If an extension is omitted, .ts
will be appended.
Specifies the module name. This name will be used as the output filename or the directory name.
Specifies the export name in the entry file to expose. If omitted, the entire entry module will be used as a namespace and will be exposed (such as import * as XXX from '...'; export = XXX;
).
To expose default, use '--export default'.
Specifies the root variable (entity) name. This name will be used as a global entity of the exported data (e.g. export as namespace XXX;
). If omitted, the root name will not be created. This is useful for the modules exposing the global namespace (like UMD modules); if the declaration file is used for the type reference (e.g. with typeRoots
option or reference
directive), you can use the module via the namespace name without import
ing.
You can specify a nested namespace name like Some.Namespace.Name
; if specified, all namespaces will be created.
Specifies the output directory. Note that you cannot specify the output filename directly; use --outDir
and --moduleName
.
'module' | 'namespace'
)Specifies the declaration style. Following style names are valid.
'module'
(default)Outputs two files named <moduleName>/index.d.ts
and <moduleName>/<moduleName>.d.ts
. index.d.ts
refers <moduleName>.d.ts
with reference
directive, and <moduleName>.d.ts
contains all modules in the project. For putting <moduleName>/
directory to your directory for external modules, you can use the module with import ... from '<moduleName>'
. You can also import
child modules, but it may cause errors because of lacks of actual child modules' sources (e.g. using with concatenated JS module).
'namespace'
[Experimental] Outputs one file named <moduleName>.d.ts
, containing dummy namespaces and exported entities. You can use import ... from '<moduleName>'
, but cannot import child modules.
This style declares dummy namespaces, and some entity types may be differ from actual types. And, for restriction of specification, the default
will be renamed to _default
(or other name specified with --defaultName
option). You can still use default
to the option --export
(renamed automatically), but cannot use default
for the descendant entities.
Specifies the entity name to rename from default
. If omitted, _default
will be used. This option will be ignored if 'module'
-style is used.
Specifies the dummy binding name for importing external modules (e.g. import __module from '<external-module>'
). Default is __module
.
Outputs all imports and exports in the sources of the project file. If this option is specified, no files are outputted.
Shows the version number.
Output examples for both 'module-style' and 'namespace-style' is in the examples directory. For creating module-style, enter the following command on the directory:
dts-pack -p ./tsconfig.json -e index.ts -m myModule -s module -x default -o ./dist-module-style
For creating namespace-style, change 'module' of the command line above to 'namespace'.
MIT License
v0.1.0
FAQs
TypeScript declaration file (.d.ts) packager for ES6-module based program
The npm package dts-pack receives a total of 7 weekly downloads. As such, dts-pack popularity was classified as not popular.
We found that dts-pack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.