denoland / denoland/dnt

npm package pragma?

Open
#73 0 comments 6 reactions 0 assignees View on GitHub
suggestion
Dominant language
Rust
Stars
1.3k
Forks
49
PR merge metrics
No merged PRs in 30d

Description

It might be useful for a module to be able to specify that it's available as an npm package. Perhaps this could be some dnt specific pragma that lives in the file being imported that says the npm package name.

So, for example, say in `https://deno.land/x/code_block_writer@12.0.0/mod.ts`:

```ts
// dnt-npm-package: code-block-writer

export default class Writer {
}
```

Then:

```ts
import CodeBlockWriter from "https://deno.land/x/code_block_writer@12.0.0/mod.ts";
```

Would go to:

```ts
import CodeBlockWriter from "code-block-writer";
```

With a dependency of `^12.0.0`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.