mirror of
https://github.com/denoland/deno.git
synced 2025-01-08 23:28:18 -05:00
c6d1b0a1cc
This allows using npm deps of jsr deps without having to add them to the root package.json. Works by taking the package requirement and scanning the `node_modules/.deno` directory for the best matching package, so it relies on deno's node_modules structure. Additionally to make the transition from package.json to deno.json easier, Deno now: 1. Installs npm deps in a deno.json at the same time as installing npm deps from a package.json. 2. Uses the alias in the import map for `node_modules/<alias>` for better package.json compatiblity.
10 lines
248 B
TypeScript
10 lines
248 B
TypeScript
const entries = Array.from(
|
|
Deno.readDirSync(new URL("./node_modules", import.meta.url)),
|
|
);
|
|
const names = entries.map((entry) => entry.name);
|
|
names.sort();
|
|
|
|
// won't have the invalid path alias
|
|
for (const name of names) {
|
|
console.log(name);
|
|
}
|