Skip to main content
Deno 2 is finally here 🎉️
Learn more

🍹dlink 🦕

Build Status https://img.shields.io/github/tag/keroxp/dlink.svg license

Deno module linker

Concept

dlink is designed to manage URL module specifiers for Deno.

Managing URL module specifier in Deno is qutie hard. dlink is designed to resolve these problems by familiar way for developers.

Install

$ deno install --allow-write --allow-read --allow-net https://deno.land/x/dlink/dlink.ts

with install directory:

$ deno install --allow-write --allow-read --allow-net --root /usr/local https://deno.land/x/dlink/dlink.ts

Usage

$ cd ./project
$ dlink

2. Edit modules.json file

{
  "https://deno.land/std": {
    "version": "@v0.32.0",
    "modules": ["/fs/mod.ts", "/fs/path.ts", "/flags/mod.ts"]
  }
}
$ dlink
Linked: https://deno.land/std@v0.32.0/fs/mod.ts -> ./vendor/https/deno.land/std/fs/mod.ts
Linked: https://deno.land/std@v0.32.0/fs/path.ts -> ./vendor/https/deno.land/std/fs/path.ts
Linked: https://deno.land/std@v0.32.0/flags/mod.ts -> ./vendor/https/deno.land/std/flags/mod.ts

dlink will automatically create module asias files that are described in modules.json. If there are modules.json like below:

{
  ":moduleId": {
    "version": ":version",
    "modules": [":moduleFile"]
  }
}
  • Alias for ":modileFile" will be created at: ./vendor/{:moduleId}/{:moduleFile}
  • Aalis is contains: export * from "{:moduleId}{:version}{:moduleFile}"

3. Import module aliases

import * fs from "./vendor/https/deno.land/std/fs/mod.ts"

Prior works

LICENSE

MIT