Skip to content

outSH/to-esm-imports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to-esm-imports

  • Simple script for transforming relative file imports to ESM-conformant ones (i.e. link to actual file with .js extension)
  • Works with TypeScript source files (.ts extension)
  • Can be used to transform single file or entire directory (recursively).
  • Will ignore dirs from local .gitignore (run this tool from project root).
  • Used to transform https://github.com/hyperledger/cacti sources (where other solutions failed), not tested on other repos (feel free to file an issue if more cases must be handled).
  • Tested on Linux only!

Usage

# Show help
to-esm-imports -h

# Convert local repository
to-esm-imports .

# Convert single file
to-esm-imports ./src/foo/bar.ts

# Use different logLevel
to-esm-imports --logLevel warn .

Build and install locally

npm install
npm run build
npm install -g .
# to-esm-imports CLI should be available

About

Migrate typescript files to ESM style of import (with .js extension)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published