Update to v13 and add queue and completely change code
This commit is contained in:
parent
dcef23d0ed
commit
55a38726a3
6706 changed files with 424137 additions and 61608 deletions
76
node_modules/dasu/README.md
generated
vendored
Normal file
76
node_modules/dasu/README.md
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
[](https://www.npmjs.com/package/dasu)
|
||||
[](https://www.npmjs.com/package/dasu)
|
||||
[](https://www.npmjs.com/package/dasu)
|
||||

|
||||

|
||||

|
||||
|
||||
# 出す ー dasu
|
||||
## The same xhr API for both client and server
|
||||
|
||||
Simple to use:
|
||||
```javascript
|
||||
var dasu = require('dasu')
|
||||
var req = dasu.req
|
||||
|
||||
// same params as Node's require('http').request
|
||||
var params = {
|
||||
method: 'GET',
|
||||
protocol: 'http',
|
||||
hostname: 'uinames.com',
|
||||
port: 80,
|
||||
path: '/api/',
|
||||
}
|
||||
|
||||
req(params, function (err, res, data) {
|
||||
console.log(res.statusCode)
|
||||
console.log(res.headers)
|
||||
var json = JSON.parse(data)
|
||||
console.log(json)
|
||||
// eg: {"name":"Milica","surname":"Maslo","gender":"female","region":"Slovakia"}
|
||||
})
|
||||
|
||||
|
||||
// turn auto-follow redirects off
|
||||
dasu.follow = false
|
||||
|
||||
// force mode 'node', 'browser', 'auto'
|
||||
// (useful with Electron etc)
|
||||
dasu.mode = 'auto' // uses window.XMLHttpRequest if available
|
||||
```
|
||||
|
||||
## Test in browser
|
||||
https://runkit.com/talmobi/runkit-npm-dasu
|
||||
|
||||
## About
|
||||
Using XMLHttpRequest or Node's http libraries under the hood, **dasu** aims to streamline your basic xhr for both contexts. It provides the familiar structure to Node's http library (http://devdocs.io/node/http#http_http_request_options_callback)
|
||||
|
||||
|
||||
## Why
|
||||
Test your client side request/fetch/xhr logic on the server side with the same api you're using on the client.
|
||||
|
||||
## Alternatives
|
||||
https://github.com/visionmedia/superagent
|
||||
|
||||
|
||||
## Install
|
||||
from npm
|
||||
```
|
||||
npm install --save dasu
|
||||
```
|
||||
|
||||
from source
|
||||
```
|
||||
git clone https://github.com/talmobi/dasu
|
||||
cd dasu
|
||||
npm install
|
||||
```
|
||||
|
||||
|
||||
## Test
|
||||
```
|
||||
git clone https://github.com/talmobi/dasu
|
||||
cd dasu
|
||||
npm install
|
||||
npm test
|
||||
```
|
1
node_modules/dasu/dist/dasu.min.js
generated
vendored
Normal file
1
node_modules/dasu/dist/dasu.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
40
node_modules/dasu/package.json
generated
vendored
Normal file
40
node_modules/dasu/package.json
generated
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"name": "dasu",
|
||||
"version": "0.4.2",
|
||||
"description": "Consistent xhr API for both client and server (http.request)",
|
||||
"main": "dist/dasu.min.js",
|
||||
"files": [
|
||||
"dist/dasu.min.js"
|
||||
],
|
||||
"scripts": {
|
||||
"watch": "miru -f dasu.js -e 'npm run build'",
|
||||
"build": "npm run build:js && npm run build:js:min",
|
||||
"build:js": "rollup -f umd dasu.js > dist/dasu.js",
|
||||
"build:js:min": "uglifyjs dist/dasu.js -cmo dist/dasu.min.js",
|
||||
"prepublish": "npm run lint && npm run build && npm test",
|
||||
"passlint": "passlint dist/dasu.js dist/dasu.min.js",
|
||||
"lint": "spacestandard --fix dasu.js",
|
||||
"test:only": "tape test/*test*.js",
|
||||
"test": "npm run lint && npm run build && tape test/*test*.js | faucet && npm run passlint"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/talmobi/dasu"
|
||||
},
|
||||
"author": "talmobi <talmo.christian@gmail.com>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/talmobi/dasu/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"body-parser": "~1.19.0",
|
||||
"express": "~4.17.1",
|
||||
"faucet": "0.0.1",
|
||||
"miru": "~0.14.3",
|
||||
"passlint": "0.0.13",
|
||||
"rollup": "~0.33.1",
|
||||
"spacestandard": "0.0.6",
|
||||
"tape": "~4.6.0",
|
||||
"uglify-js": "~2.7.5"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue