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

api-local-transfer

v1.0.16

Published

api-transfer-code

Downloads

7

Readme

##确认是否有一些历史记录或者缓存影响你的命令执行 D:\Program Files\nodejs\module 现在改到移动到E盘了导致新老命令都可以执行 都加了path

通过 apiLocal init 初始化配置文件

module.exports = {
  outputDir: "./",
  apiName: "",  // 根据文件后缀判断是ts还是js文件
  product: "",
  remote: "https://xxx/AA/BB/CC", // 若有多个 用“/” 分开,会自动获取合并
  compareLocal: false, // 是否和本地生成代码比较,如果本地规则不匹配请设置false或者不加此属性,规则目前未提供灵活自定义
  methodNameDef: function(path) {
    return path;
  }, // 方法命名规则可以自定义

  /*
  *{
  method: 'post',
  url: '/XX/XX',
  methodNameNative: 'XX_XX',
  bodyParams: 'XXRequest',
  queryParams: '',
  responseType: 'XXResponse',
  title: '名称',
  parameters: '针对ts使用, params:XXRequest '
}
  * */
  templateBody: ({ method, url, methodNameNative, bodyParams, queryParams, responseType, title, parameters }) => {
    return '';
  },
  // 方法体模板信息 写入的参数值需要确认此值是否在返回信息里
  templateWrapper: (apiSource) => {
    return `
        ${apiSource}
    `;
  },  // 方法体模板信息外面嵌套的一层

  typesSeparate: true // ts需要配置,声明文件是否分开
}

##第一步: ###npm i api-transfer-code -g 全局安装

##第二步: ###在应用根目录 执行 apiLocal init 初始化配置文件 生成 api.config.js文件

如果执行不成功 看下 NODE_PATH配置是否正确(npm config get prefix)

默认在 C:\Users**\AppData\Roaming\npm

安装了全局命令或者修改了全局环境变量,webstorm 不能及时生效,需要全部关闭

##第三步:

###配置文件所列参数 都必填