- A simple module version manager for Deno.
- dem creates
dem.json
and links script files with version.- linked scripts are stored in
vendor
directory.
- linked scripts are stored in
- dem provides an easy way to update dependencies.
Using https://deno.land/std/http/server.ts
at v0.51.0
dem.json
- generated file like a package.json
{
"modules": [
{
"protocol": "https",
"path": "deno.land/std",
"version": "v0.51.0",
"files": [
"/http/server.ts"
]
}
]
}
vendor/https/deno.land/std/http/server.ts
- generated linked script includes version specified in
dem.json
- generated linked script includes version specified in
export * from "https://deno.land/[email protected]/http/server.ts";
example.ts
- script to run
// You can import module without the version.
import { serve } from "./vendor/https/deno.land/std/http/server.ts";
deno install --allow-read --allow-write --allow-net -f -n dem https://deno.land/x/[email protected]/cmd.ts
$ dem init
successfully initialized the project.
$ dem add https://deno.land/[email protected]
successfully added new module: https://deno.land/std, version: v0.51.0
example.ts
import * as path from './vendor/https/deno.land/std/fs/path.ts';
console.log(path.join(Deno.cwd(), 'example'));
$ dem ensure
successfully created link: https://deno.land/[email protected]/fs/path.ts
$ deno example.ts
dem update
updates versions indem.json
and linked scripts.
$ dem update https://deno.land/[email protected]
successfully updated module: https://deno.land/std, version: v0.52.0
- With alias, shortened script paths are available.
example.ts
// Original
import * as dejs from "./vendor/https/deno.land/x/dejs/mod.ts"
// With alias
import * as dejs from "./vendor/dejs.ts"
- execute
dem alias
.
# create alias for module.
$ dem alias https://deno.land/x/dejs/mod.ts dejs.ts # ./vendor/dejs.ts will be created.
- import script using alias path
import * as dejs from "./vendor/dejs.ts"
- run
dem ensure
.
# create link for `./vendor/https/deno.land/x/dejs/mod.ts`.
$ dem ensure
dem init # initialize dem.json
dem add https://deno.land/x/[email protected] # add module `dejs` and set its version to `0.1.0`
dem link https://deno.land/x/dejs/mod.ts # create link of `[email protected]/mod.ts` and put it into vendor.
dem update https://deno.land/x/[email protected] # update module to `0.2.0`
dem unlink https://deno.land/x/dejs/mod.ts # remove link of `[email protected]/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.
- default export
- manage
.d.ts
file
syumai
MIT