Skip to content

keroxp/dlink

Repository files navigation

🍹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

1. Run dlink

$ 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"]
  }
}

2. Run dlink command

$ dlink
Linked: https://deno.land/[email protected]/fs/mod.ts -> ./vendor/https/deno.land/std/fs/mod.ts
Linked: https://deno.land/[email protected]/fs/path.ts -> ./vendor/https/deno.land/std/fs/path.ts
Linked: https://deno.land/[email protected]/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