star-wars-api:swapi.co api包装器

时间:2021-04-29 06:19:05
【文件属性】:
文件名称:star-wars-api:swapi.co api包装器
文件大小:10KB
文件格式:ZIP
更新时间:2021-04-29 06:19:05
JavaScript 星球大战api 节点的swapi.co(《星球大战》 api)包装器 安装 $ npm install --save star-wars-api 用法 var StarWarsAPI = require ( 'star-wars-api' ) ; swapi = new StarWarsAPI ( ) ; 得到 所有方法都返回一个蓝鸟承诺。 .get需要两个参数,一个resource和一个id 。 id可以是string , number或array 。 swapi . get ( 'people' , 1 ) . then ( person => /* do something */ ) . catch ( err => /* handle error */ ) ; swapi . get ( 'starships' , [ 9 , 10 ] )
【文件预览】:
star-wars-api-master
----.gitignore(33B)
----.babelrc(3B)
----.eslintrc(2KB)
----package.json(1KB)
----.travis.yml(48B)
----gulpfile.js(2KB)
----LICENSE(1KB)
----README.md(2KB)
----lib()
--------index.js(2KB)
--------utils.js(310B)
----.gitattributes(12B)
----test()
--------unit.js(6KB)
--------integration.js(6KB)
--------stubs()
----.editorconfig(171B)

网友评论