npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@teidesu/deno-types

v2.1.1

Published

TypeScript definitions for Deno

Downloads

837

Readme

deno-types

NPM Version Generate and publish release

due to the lack of properly packaged Deno types for tsc, this repository tries to fill that gap between the node.js ecosystem and the Deno runtime.

the package is updated automatically in ci, and should be up-to-date with the latest Deno release version. if you notice something is missing, feel free to open an issue or a pull request.

installation

the recommended way to install this is to install it under @types/deno alias, by putting the following in your package.json:

{
    "devDependencies": {
        "@types/deno": "npm:@teidesu/[email protected]"
    }
}

this way you can reference the types in your tsconfig.json like this (see below for more info):

{
    "compilerOptions": {
        "types": ["deno/ns"]
    }
}

(without the above, you would need to put @teidesu/deno-types instead of deno)

usage

generally, there are 2 ways to use this repository – either using pre-merged types, or referencing all bits and pieces manually.

pre-merged types

we generate 3 different flavors of pre-merged types:

| flavor | description | conflicts | | --------------- | ---------------------------------------------------------------------- | ------------------------------------------------------- | | ns | only the Deno namespace, without any other types | none | | full | all Deno-specific APIs that are not available in core TypeScript types | lib.dom.d.ts, partially @types/node, ns flavor | | free-standing | full, but linked towards Deno's own builtin libs | overrides default types, "noLib": true should be used |

for most use-cases of mixing Node.js and Deno code, the ns flavor is the best choice, as it the least amount of conflicts and links towards tsc built-in types. however it should be noted that ns may lag behind some features, as it is only automatically updated to a certain extent.

to use a flavor, you can reference it in your tsconfig.json like this:

{
    "compilerOptions": {
        "types": ["deno/ns"]
    }
}

or using the /// <reference types="deno/ns" /> directive in your TypeScript files.

manual types

you can also reference the needed types manually. for a list of all available types, the best way is to just look around in the installation directory (e.g. node_modules/@types/deno), since the structure may change over time. for example, for Deno's fetch API, you would use the following:

// this one links towards typescript's built-in libs
/// <reference types="deno/ext_tslib/lib.deno.fetch" />

// this will link towards Deno's own libs
/// <reference types="deno/ext/lib.deno.fetch" />

running the script

bun install
bun run src/main.ts --ref main

license

this repository itself is licensed under MIT license.

the generated packages are licensed under the license stated at the beginning of each file, as some files are taken from the TypeScript repository (Apache-2.0) and some are taken from the Deno repository (MIT).