1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 23:59:59 -05:00
denoland-deno/cli/tests/testdata/npm/cjs_yargs/main.js
Bartek Iwańczuk e7d7da85df
fix(npm): fix CJS resolution with local node_modules dir (#16547)
This commit fixes CJS resolution when there's a local "node_modules/"
directory.

Before this commit relative imports from CJS files where resolved
relative to
root directory of the package instead of relative to referrer file.
2022-11-06 00:58:21 +01:00

20 lines
464 B
JavaScript

import yargs from "npm:yargs@15.4.1";
const args = yargs(["serve", "8000"])
.command("serve [port]", "start the server", (yargs) => {
return yargs
.positional("port", {
describe: "port to bind on",
default: 5000,
});
}, (argv) => {
console.info(`start server on :${argv.port}`);
})
.option("verbose", {
alias: "v",
type: "boolean",
description: "Run with verbose logging",
})
.argv;
console.log(args);