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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nei-interface

v3.1.1

Published

auto create interface by nei

Downloads

37

Readme

nei-interface

利用nei内部查询数据接口,获取数据,生成typescript的interface文件,以及ajax 接口文件

Usage

npm install nei-interface -g (最好全局安装)

第一种用法:

创建项目的 .interfacerc.json文件
{
    "PLATFORM_ID": , //找杭研 nei后端 @包勇明 获取 platformId 
    "SALT": "", //找杭研 nei后端 @包勇明 获取 salt 
    "PROJECT_ID": 0, //nei 页面url 即可获取
    "TYPES_DIST": "./src/javascript/common/interface/" //自己需要生成的types文件的目录 
}

执行 neiI -c .interface.json 命令,自动生成interface文件 // 每次nei定义的接口声明变更都需要运行此命令哦

第二种用法

在gulpfile.js中配置任务

let neiInterface = require('nei-interface');
let config = require('./.interfacerc.json')

gulp.task('interface', () => {
    neiInterface(config)
});

gulp interface //生成interface文件

config 参数说明 PLATFORM_ID: ,//找杭研 nei后端 @包勇明 获取 platformId //tip: 无默认值,自行设置 SALT: ',//找杭研 nei后端 @包勇明 获取 salt //tip: 无默认值,自行设置 PROJECT_ID: , // nei 页面url 即可获取 //tip: 无默认值,自行设置 API_DIST:'./api',// api 存放的目录位置,默认./api/index.ts 文件 TYPES_DIST: './types', //自己需要生成的types文件的目录 TYPES_NAME1: 'project.ts', // 项目接口相关数据模型的interface文件,默认值为
TYPES_NAME2: 'common.ts',//公共部分数据模型的interface文件, API_PREINIT:[],//是否需要自动生成ajaxAPI //tip: 默认为[],即不自动生成./api/index.ts 文件 BASE_TYPES: { Number: 'number', Boolean: 'boolean', String: 'string', File: 'any',//需要验证ts是否支持文件类型 Variable: 'any'//可变类型 }, HOSTNAME: 'nei.netease.com', SAFE_MODE: false // 默认为false表示{name: string},为true表示{name?: string},不影响入参模型 }