Skip to content

Commit aa4b9d3

Browse files
committed
initial commit, v1.0.0
0 parents  commit aa4b9d3

37 files changed

+4400
-0
lines changed

.babelrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": ["env"],
3+
"plugins": ["babel-plugin-add-module-exports"],
4+
"env": {
5+
"test": {
6+
"plugins": [
7+
["istanbul"]
8+
]
9+
}
10+
}
11+
}

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = LF
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

.eslintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "airbnb-base",
3+
"rules": {
4+
"camelcase":"off",
5+
"import/named": "off"
6+
}
7+
}

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Runtime data
6+
pids
7+
*.pid
8+
*.seed
9+
10+
# Directory for instrumented libs generated by jscoverage/JSCover
11+
lib-cov
12+
13+
# Coverage directory used by tools like istanbul
14+
coverage
15+
.nyc_output
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directory
27+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
28+
node_modules
29+
30+
# Remove some common IDE working directories
31+
.idea
32+
.vscode
33+
34+
.DS_Store
35+
36+
dist/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v6.10

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 Listen 1
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# listen1-api
2+
3+
listen1音乐资源API库,可运行在 Nodejs 和 浏览器环境(限chrome extension 或 electron)
4+
5+
## 特性
6+
7+
* 集成网易,QQ,虾米,酷狗,酷我,Bilibili平台的音乐资源API
8+
* 支持获取热门歌单,歌手歌单,专辑歌单
9+
* 支持搜索歌曲
10+
* 支持获取歌曲歌词信息
11+
* 支持获取歌曲的播放地址
12+
13+
## 编译
14+
```
15+
$ git clone git@github.com:listen1/listen1-api.git
16+
$ cd listen1-api
17+
$ yarn install
18+
$ yarn build
19+
```
20+
编译后文件在dist目录下,`listen1-api.js``listen1-api.min.js`
21+
22+
## 安装
23+
浏览器环境
24+
```html
25+
<script src="listen1-api.min.js"></script>
26+
<script>
27+
console.log(listen1Api);
28+
</script>
29+
```
30+
Nodejs环境
31+
```javascript
32+
const listen1Api = require('./listen1-api.min');
33+
```
34+
35+
## 开始使用 (nodejs 环境)
36+
37+
下载压缩版本,或dist目录下的`listen1-api.min.js`到本地目录
38+
39+
```javascript
40+
const listen1Api = require('./listen1-api.min');
41+
const platform = 'netease';
42+
// 获取网易平台的热门歌单列表
43+
const url = '/show_playlist?source='+platform;
44+
45+
listen1Api.apiGet(url).then((data) => {
46+
console.log(data);
47+
});
48+
```
49+
50+
## 文档
51+
https://listen1.github.io/listen1-api
52+
53+
## 项目技术
54+
* 使用[webpack-library-starter](https://github.com/krasimir/webpack-library-starter.git)模板建立项目。
55+
* 基于Webpack 4打包。
56+
* ES6 语法。
57+
* 导出[umd](https://github.com/umdjs/umd)格式的包,支持在浏览器环境和nodejs环境运行。
58+
* ES6 测试基于 [Mocha](http://mochajs.org/)[Chai](http://chaijs.com/)
59+
* 使用[ESLint](http://eslint.org/)进行语法检查。
60+
61+
## 开发使用
62+
63+
1. 编译生成
64+
* 运行 `yarn install` (推荐) 或 `npm install` ,安装依赖包。
65+
* 运行 `yarn build``npm run build` 来生成压缩版本的库文件。
66+
2. 开发者模式
67+
* 运行 `yarn dev``npm run dev` 安装依赖包。生成一个非压缩版本的库文件并且在文件变化时自动重新编译。
68+
3. 运行测试
69+
* 运行 `yarn test``npm run test`
70+
71+
## 常用命令
72+
73+
* `yarn build` or `npm run build` - 在dist目录下编译生成正式版的库文件。
74+
* `yarn dev` or `npm run dev` - 编译生成dev版本的库并实时更新。
75+
* `yarn test` or `npm run test` - 运行测试。
76+
* `yarn test:watch` or `npm run test:watch` - 在watch模式运行测试。

docs/.nojekyll

Whitespace-only changes.

docs/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# listen1-api
2+
3+
listen1音乐资源API库,可运行在 Nodejs 和 浏览器环境(限chrome extension 或 electron)
4+
5+
## 特性
6+
7+
* 集成网易,QQ,虾米,酷狗,酷我,Bilibili平台的音乐资源API
8+
* 支持获取热门歌单,歌手歌单,专辑歌单
9+
* 支持搜索歌曲
10+
* 支持获取歌曲歌词信息
11+
* 支持获取歌曲的播放地址
12+
13+
## 编译
14+
```
15+
$ git clone git@github.com:listen1/listen1-api.git
16+
$ cd listen1-api
17+
$ yarn install
18+
$ yarn build
19+
```
20+
编译后文件在dist目录下,`listen1-api.js``listen1-api.min.js`
21+
22+
## 安装
23+
浏览器环境
24+
```html
25+
<script src="listen1-api.min.js"></script>
26+
<script>
27+
console.log(listen1Api);
28+
</script>
29+
```
30+
Nodejs环境
31+
```javascript
32+
const listen1Api = require('./listen1-api.min');
33+
```
34+
35+
## 开始使用 (nodejs 环境)
36+
37+
下载压缩版本,或dist目录下的`listen1-api.min.js`到本地目录
38+
39+
```javascript
40+
const listen1Api = require('./listen1-api.min');
41+
const platform = 'netease';
42+
// 获取网易平台的热门歌单列表
43+
const url = '/show_playlist?source='+platform;
44+
45+
listen1Api.apiGet(url).then((data) => {
46+
console.log(data);
47+
});
48+
```
49+
50+
## 项目技术
51+
* 使用[webpack-library-starter](https://github.com/krasimir/webpack-library-starter.git)模板建立项目。
52+
* 基于Webpack 4打包。
53+
* ES6 语法。
54+
* 导出[umd](https://github.com/umdjs/umd)格式的包,支持在浏览器环境和nodejs环境运行。
55+
* ES6 测试基于 [Mocha](http://mochajs.org/)[Chai](http://chaijs.com/)
56+
* 使用[ESLint](http://eslint.org/)进行语法检查。
57+
58+
## 常用命令
59+
60+
* `yarn build` or `npm run build` - 在dist目录下编译生成正式版的库文件。
61+
* `yarn dev` or `npm run dev` - 编译生成dev版本的库并实时更新。
62+
* `yarn test` or `npm run test` - 运行测试。
63+
* `yarn test:watch` or `npm run test:watch` - 在watch模式运行测试。

0 commit comments

Comments
 (0)