
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@2bad/tsfix
Advanced tools
[](https://www.npmjs.com/package/@2bad/tsfix) [](https://www.npmjs.com/package/@2bad/tsfix) [npm install --save-dev @2bad/tsfix
Then add postbuild script to your package.json:
{
"scripts": {
"build": "tsc",
"postbuild": "tsfix"
}
}
That's it. TSFIX finds your TypeScript output and fixes all import issues automatically.
// Before TypeScript Compilation
import { helper } from './utils/helper.ts'
// After TypeScript Compilation (BROKEN)
import { helper } from './utils/helper.ts'
// After TSFIX (FIXED)
import { helper } from './utils/helper.js' // Works in ESM!
// tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}
}
// Before TypeScript Compilation
import { Button } from '@/components/Button'
// After TypeScript Compilation (BROKEN)
import { Button } from '@/components/Button'
// After TSFIX (FIXED)
import { Button } from './src/components/Button.js' // Correctly resolved!
// Before TypeScript Compilation
import { config } from './config'
// After TypeScript Compilation (BROKEN)
import { config } from './config'
// After TSFIX (FIXED)
import { config } from './config/index.js' // Properly resolved!
# Use AST-based extraction (more accurate but slower)
npx @2bad/tsfix --mode ast
# Custom file matching pattern
npx @2bad/tsfix --pattern "**/*.js"
# Enable all debug logging
DEBUG=* tsfix
# Only enable specific components
DEBUG=tsfix:main,tsfix:extractor tsfix
# Show only fixer operations
DEBUG=tsfix:fixer tsfix
rewriteRelativeImportExtensions doesn't rewrite extensions in emitted declaration files (2025)TSFIX offers two extraction engines:
Contributions welcome! Open issues for bugs/features or submit PRs with improvements.
FAQs
[](https://www.npmjs.com/package/@2bad/tsfix) [](https://www.npmjs.com/package/@2bad/tsfix) [
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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.