@yuw-cli-dev/request 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +11 -0
  2. package/lib/index.js +20 -0
  3. package/package.json +33 -0
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # `@yuw-cli-dev/request`
2
+
3
+ > TODO: description
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ const request = require('@yuw-cli-dev/request');
9
+
10
+ // TODO: DEMONSTRATE API
11
+ ```
package/lib/index.js ADDED
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ const axios = require('axios');
4
+ const BASE_URL = process.env.YUW_CLI_BASE_URL || 'http://127.0.0.1:7001/';
5
+
6
+ const request = axios.create({
7
+ baseURL: BASE_URL,
8
+ timeout: 5000,
9
+ });
10
+
11
+ request.interceptors.response.use(
12
+ response => {
13
+ return response.data;
14
+ },
15
+ error => {
16
+ return Promise.reject(error);
17
+ },
18
+ );
19
+
20
+ module.exports = request;
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@yuw-cli-dev/request",
3
+ "version": "1.0.38",
4
+ "description": "request package",
5
+ "author": "yuwei <yuwei@huya.com>",
6
+ "homepage": "https://github.com/yousanjin/yuw-cli#readme",
7
+ "license": "ISC",
8
+ "main": "lib/index.js",
9
+ "directories": {
10
+ "lib": "lib",
11
+ "test": "__tests__"
12
+ },
13
+ "files": [
14
+ "lib"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/yousanjin/yuw-cli.git"
22
+ },
23
+ "scripts": {
24
+ "test": "echo \"Error: run tests from root\" && exit 1"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/yousanjin/yuw-cli/issues"
28
+ },
29
+ "dependencies": {
30
+ "axios": "^1.13.4"
31
+ },
32
+ "gitHead": "f92c3015d6799312f5c9b446775cfb5ed577eeed"
33
+ }