
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
esm-loader-typescript
Advanced tools
Node.js ESModule Loader for importing and loading
Typescript (.ts
) files and transpiling on the fly.
Warning! Using experimental Node.js features and flags, API will likely change. This may be helpful for development and testing, but should not be used in production.
npm install --save-dev esm-loader-typescript
We want to import a .ts
file with Node.js:
// index.ts
const words: string = 'hello'
console.log(words)
// 'hello'
# node >= 20.7
cat << EOF > ./register.js
import { register } from 'node:module'
register('esm-loader-typescript', import.meta.url)
EOF
NODE_OPTIONS="--import ./register.js" node index.ts
# node < 20.7
NODE_OPTIONS="--loader esm-loader-typescript" node index.ts
This loader can be configured, and chained with other loaders, using node-esm-loader.
npm install --save-dev node-esm-loader
// .loaderrc.js
export default {
loaders: ['esm-loader-typescript'],
}
# node >= 20.7
NODE_OPTIONS="--import node-esm-loader/register" node index.ts
# node < 20.7
NODE_OPTIONS="--loader node-esm-loader" node index.ts
You may specify a custom TypeScript config filename to use:
// .loaderrc.js
export default {
loaders: [
{
loader: 'esm-loader-typescript',
options: {
config: 'tsconfig-custom.json',
},
},
],
}
Otherwise, if a tsconfig.json
file is found, it will be loaded and used.
// .loaderrc.js
export default {
loaders: [
{
loader: 'esm-loader-typescript',
options: {
debug: true,
},
},
],
}
FAQs
Chainable ESModule Loader for Typescript
We found that esm-loader-typescript 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
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.