Home

Awesome

dem

Build Status

Example

Using https://deno.land/std/http/server.ts at v0.51.0

{
  "modules": [
    {
      "protocol": "https",
      "path": "deno.land/std",
      "version": "v0.51.0",
      "files": [
        "/http/server.ts"
      ]
    }
  ]
}
export * from "https://deno.land/std@v0.51.0/http/server.ts";
// You can import module without the version.
import { serve } from "./vendor/https/deno.land/std/http/server.ts";

Install

deno install --allow-read --allow-write --allow-net -f -n dem https://deno.land/x/dem@0.9.9/cmd.ts

Usage

Getting Started

1. dem init to create dem.json

$ dem init
successfully initialized the project.

2. dem add to add module.

$ dem add https://deno.land/std@v0.51.0
successfully added new module: https://deno.land/std, version: v0.51.0

3. Edit your script and import module from vendor.

example.ts

import * as path from './vendor/https/deno.land/std/fs/path.ts';

console.log(path.join(Deno.cwd(), 'example'));

4. dem ensure to resolve modules.

$ dem ensure
successfully created link: https://deno.land/std@v0.51.0/fs/path.ts

5. Run your script.

$ deno example.ts

Standard Usage

Updating module

$ dem update https://deno.land/std@v0.52.0
successfully updated module: https://deno.land/std, version: v0.52.0

Advanced Usage

Alias

example.ts

// Original
import * as dejs from "./vendor/https/deno.land/x/dejs/mod.ts"
// With alias
import * as dejs from "./vendor/dejs.ts"

How to use alias

  1. execute dem alias.
# create alias for module.
$ dem alias https://deno.land/x/dejs/mod.ts dejs.ts # ./vendor/dejs.ts will be created.
  1. import script using alias path
import * as dejs from "./vendor/dejs.ts"
  1. run dem ensure.
# create link for `./vendor/https/deno.land/x/dejs/mod.ts`.
$ dem ensure

Commands

dem init                                          # initialize dem.json
dem add https://deno.land/x/dejs@0.1.0            # add module `dejs` and set its version to `0.1.0`
dem link https://deno.land/x/dejs/mod.ts          # create link of `dejs@0.1.0/mod.ts` and put it into vendor.
dem update https://deno.land/x/dejs@0.2.0         # update module to `0.2.0`
dem unlink https://deno.land/x/dejs/mod.ts        # remove link of `dejs@0.2.0/mod.ts`.
dem remove https://deno.land/x/dejs               # remove module `dejs`
dem ensure                                        # resolve file paths of added modules used in project and link them.
dem prune                                         # remove unused modules and linked scripts.
dem alias https://deno.land/x/dejs/mod.ts dejs.ts # create alias for module and put it into vendor.
dem unalias dejs.ts                               # remove alias for module.

Unsupported features

Author

syumai

License

MIT