
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
lightning-dts
Advanced tools
Lightning-fast TypeScript .d.ts generator and bundler with sourcemap support and ability to resolve types from node_modules, all at blazing speed.
| Tool | Execution Time | Comparison |
|---|---|---|
| lightning-dts | 0.64ms ⚡️ | baseline |
| rolldown-plugin-dts | 49.51ms | 77.74x slower |
| rollup-plugin-dts | 84.43ms | 132.55x slower |
| dts-bundle-generator | 833.71ms | 1308.90x slower |
Benchmarks run on identical code with sourcemap generation enabled
.d.ts file ready to ship# npm
npm install lightning-dts --save-dev
# bun
bun add lightning-dts --dev
# pnpm
pnpm add lightning-dts -D
import { generateDts } from 'lightning-dts';
// Basic usage
const result = generateDts('./src/index.ts');
// With options
const result = generateDts('./src/index.ts', {
rootDir: './src',
sourcemap: true,
stripInternal: true,
preferredTsConfigPath: './tsconfig.build.json',
resolve: true, // resolve all external modules from node_modules
});
// Access the generated declaration
console.log(result.code);
// Access sourcemap if enabled
console.log(result.map);
// Handle any errors
if (result.errors.length > 0) {
console.error(result.errors);
}
generateDts(entryFilePath, options?)Generates and bundles TypeScript declaration files.
entryFilePath: Path to the entry TypeScript fileoptions: (Optional) Configuration options
rootDir: Root directory of the project (default: process.cwd())preferredTsConfigPath: Path to the preferred tsconfig.json file (by default, the closest tsconfig.json will be used)resolve: Controls which external modules should be resolved:
true to resolve all external modulesfalse or undefined to disable external resolutionsourcemap: Generate sourcemap (default: false)stripInternal: Remove declarations marked as @internal (default: false){
code: string; // The generated .d.ts content
errors: OxcError[]; // Any errors encountered during generation
map?: SourceMap; // Sourcemap (if enabled)
}
For guidelines on contributing, please read the contributing guide.
FAQs
Lightning-fast TypeScript .d.ts generator and bundler ⚡️
We found that lightning-dts 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.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.