requirejs-esm 2.4.1 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022 Ferdinand Prantl
3
+ Copyright (c) 2022-2024 Ferdinand Prantl
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -176,7 +176,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.
176
176
 
177
177
  ## License
178
178
 
179
- Copyright (c) 2022 Ferdinand Prantl
179
+ Copyright (c) 2022-2024 Ferdinand Prantl
180
180
 
181
181
  Licensed under the MIT license.
182
182
 
@@ -1,13 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // Require module dependencies.
4
- const commander = require('commander')
4
+ const { Command } = require('commander')
5
5
  const glob = require('tiny-glob')
6
6
  const { readFile, writeFile } = require('fs/promises')
7
7
  const { transform } = require('../dist/api')
8
8
 
9
9
  // Define the command-line interface.
10
- commander.description('Transforms an ESM module to AMD or adapts an AMD module for requirejs-esm.')
10
+ const program = new Command()
11
+ program.description('Transforms an ESM module to AMD or adapts an AMD module for requirejs-esm.')
11
12
  .name('esm2requirejs')
12
13
  .usage('[options] <files>')
13
14
  // .option('-e, --ecma <version>', 'change the ECMAScript version from 2020 to other one')
@@ -36,10 +37,10 @@ const {
36
37
  output: outputFile,
37
38
  rewrite,
38
39
  verbose
39
- } = commander.opts()
40
- const { args } = commander
40
+ } = program.opts()
41
+ const { args } = program
41
42
  if (!args.length) {
42
- commander.help()
43
+ program.help()
43
44
  }
44
45
 
45
46
  // Main entry point.