Giter VIP home page Giter VIP logo

listen1-api's Introduction

listen1-api

listen1音乐资源API库,可运行在 Nodejs 和 浏览器环境(限chrome extension 或 electron)

特性

  • 集成网易,QQ,虾米,酷狗,酷我,Bilibili平台的音乐资源API
  • 支持获取热门歌单,歌手歌单,专辑歌单
  • 支持搜索歌曲
  • 支持获取歌曲歌词信息
  • 支持获取歌曲的播放地址

编译

$ git clone [email protected]:listen1/listen1-api.git
$ cd listen1-api
$ yarn install
$ yarn build

编译后文件在dist目录下,listen1-api.jslisten1-api.min.js

安装

浏览器环境

<script src="listen1-api.min.js"></script>
<script>
  console.log(listen1Api);
</script>

Nodejs环境

const listen1Api = require('./listen1-api.min');

开始使用 (nodejs 环境)

下载压缩版本,或dist目录下的listen1-api.min.js到本地目录

const listen1Api = require('./listen1-api.min');
const platform = 'netease';
// 获取网易平台的热门歌单列表
const url = '/show_playlist?source='+platform;

listen1Api.apiGet(url).then((data) => {
  console.log(data);
});

文档

https://listen1.github.io/listen1-api

项目技术

  • 使用webpack-library-starter模板建立项目。
  • 基于Webpack 4打包。
  • ES6 语法。
  • 导出umd格式的包,支持在浏览器环境和nodejs环境运行。
  • ES6 测试基于 MochaChai
  • 使用ESLint进行语法检查。

开发使用

  1. 编译生成
  • 运行 yarn install (推荐) 或 npm install ,安装依赖包。
  • 运行 yarn buildnpm run build 来生成压缩版本的库文件。
  1. 开发者模式
  • 运行 yarn devnpm run dev 安装依赖包。生成一个非压缩版本的库文件并且在文件变化时自动重新编译。
  1. 运行测试
  • 运行 yarn testnpm run test

常用命令

  • yarn build or npm run build - 在dist目录下编译生成正式版的库文件。
  • yarn dev or npm run dev - 编译生成dev版本的库并实时更新。
  • yarn test or npm run test - 运行测试。
  • yarn test:watch or npm run test:watch - 在watch模式运行测试。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.