vercel / arg

Simple argument parsing
https://npmjs.com/arg
MIT License
1.23k stars 54 forks source link

Convert to ES Modules #69

Open JuanM04 opened 2 years ago

JuanM04 commented 2 years ago

Closes #66

arg now exports a CJS and ESM version. For compatibility reasons, I've avoided using any export default, resulting in this breaking change:

const arg = require('arg')

// Before
const args = arg(/* ... */)

// After
const args = arg.run(/* ... */)

Note: that change can be avoided if the package goes ESM-only, but that seem too radical

@leerob let me now what you think about these changes

JuanM04 commented 2 years ago

I've added a pnpm build step in CI