Socket
Book a DemoInstallSign in
Socket

@dawnjs/types

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dawnjs/types

## 安装依赖

latest
Source
npmnpm
Version
2.0.2
Version published
Maintainers
4
Created
Source

@dawnjs/types

安装依赖

$ npm install --save-dev @dawnjs/types

使用方式

// 中间件的 TS 入口文件
// src/index.ts

import * as Dawn from "@dawnjs/types";

interface IOptions {
  name?: string;
  age?: number;
}

const handler: Dawn.Handler<IOptions> = opts => {
  return async (next, ctx) => {
    ctx.console.log(`My name is ${opts.name}`);
    ctx.console.log(ctx.utils.isFunction(ctx.load));
    await next();
  };
};

export default handler;

FAQs

Package last updated on 14 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts