New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@zhike/express-metadata

Package Overview
Dependencies
Maintainers
11
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhike/express-metadata

collect express metadata

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created
Source

Express 元数据收集插件

English read me

有哪些功能?

  1. 注册项目中的路由
  2. 注册改项目的作者, 版本以及依赖

通过这个可以干什么?

服务化后收集本项目相关的元数据信息(metadata)来注册到配置中心来给其他的服务调用.

参数?

metadata(router, prefix | option);

如何使用?

const express = require('express');
const metadata = require('express-metadata');
const app = metadata(express())

app.get('/awesome-uri', foo)
app.post('/awesome-uri-2', 'createUser' foo2)
.
.
.
console.log(app.metadata())
{
routersSetting:
    [
      { name: '', method: 'get', url: '/awesome-uri' },
      { name: 'createUser', method: 'post', url: '/awesome-uri-2' }
    ],
projectInfo:
    {
      name: '',
      version: '',
      author: '',
      dependencies: ''
    }
}

或者

const metadata = require('express-metadata');
const router = metadata(express.Router());

router.get('/xx', foo)
.
.
.

Keywords

FAQs

Package last updated on 26 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc