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

music-api-for-qq

v0.0.5

Published

qq music api server

Downloads

15

Readme

music-api-for-qq

QQ 音乐的 Api 接口 本接口只用于前端各个技术栈的学习用,不能做为任何的商业用途。

前提

需要 NodeJS 8.12+ 环境

安装

$ npm install music-api-for-qq -D

插件提供了两个使用方式

独立服务

需要自己重新建立一个服务文件

// 创建 server.js 文件
const musicApi = require('music-api-for-qq')

musicApi.server({
  port: 7001,                           // 启动端口  默认 8080
  host: '28.33.176.78',                 // 开启使用 ip 访问  默认访问为 localhost
  path: '/music/api',                   // 自定义路径 默认为 /music/api
  cache: false,                         // 开启缓存 默认关闭缓存, 传入 数字 为分钟 传入 false 关闭
  use: function(server,express){        // 自定义的使用其他插件
    server.use('其他插件');
    server.use('/',express.static(__dirname + "/demo"))
  }
})  

console.log('http://28.33.176.78:7001/music/api')

路由使用

做为路由使用是方便直接嵌入到现有的 webpack 工程项目中。

在 vue-cli 项目中使用

这里只演示 基于webpack-dev-server 的配置方法。其他版本的 webpack 请自行配置

// 1. 在 bulid 目录中找到 webpack.dev.conf.js 文件 引入插件 
const musicApi = require('music-api-for-qq')

// 2. 找到 devServer 对象 添加 before 属性使得插件做为路由使用 webpack-dev-server 的服务
devServer: {
  clientLogLevel: 'warning',
  historyApiFallback: {
    rewrites: [
      { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
    ],
  },
  // ......
  quiet: true, // necessary for FriendlyErrorsPlugin
  watchOptions: {
    poll: config.dev.poll,
  },

+ before: function(app) {
+  app.use('/music',musicApi.router('/api'))
+ }

// 3. 然后请求 http://localhost:8080/music/api/.... 即可
}

API 列表