Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

restl

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

restl - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

test/bootstrap.js

7

changelog.md
ChangeLog
=========
0.1.2 (2017-04-19)
------------------
* #11: Added test framework.
* #11: Added `follow()` function on Client object for an easy shortcut.
0.1.1 (2017-04-03)

@@ -5,0 +12,0 @@ ------------------

@@ -59,2 +59,13 @@ var url = require('url');

},
/**
* This funciton is a shortcut for getResource().follow(x);
*
* This function returns a resource
*/
follow: function(rel) {
return this.getResource().follow(rel);
}

@@ -61,0 +72,0 @@

12

lib/resource.js

@@ -40,5 +40,9 @@ 'use strict';

}).then(function() {
// Wipe out the local cache
this.repr = null;
return null;
});
}.bind(this));
},

@@ -56,5 +60,9 @@

}).then(function() {
// Wipe out the local cache
this.repr = null;
return null;
});
}.bind(this));
},

@@ -61,0 +69,0 @@

16

package.json
{
"name": "restl",
"version": "0.1.1",
"version": "0.1.2",
"description": "Opiniated HAL client.",
"main": "lib/index.js",
"scripts": {
"test": "mocha"
"test": "eslint lib/ && nyc mocha"
},

@@ -29,2 +29,3 @@ "repository": {

"bluebird": "^3.4.7",
"node-fetch": "^1.6.3",
"request": "^2.79.0",

@@ -34,7 +35,10 @@ "request-promise-any": "^1.0.3"

"devDependencies": {
"eslint": "^3.15.0"
},
"scripts" : {
"test" : "eslint lib/"
"chai": "^3.5.0",
"eslint": "^3.15.0",
"koa": "^2.2.0",
"koa-logger": "^2.0.1",
"koa-path-match": "^2.0.0",
"mocha": "^3.2.0",
"nyc": "^10.2.0"
}
}

@@ -1,30 +0,14 @@

var restl = require('.');
var FooPromise = function() {
Promise.apply(this, arguments);
}
var options = {
auth: {
user: 'developers@getturnstyle.com',
pass: 'password'
}
}
FooPromise.prototype = Object.create(Promise.prototype);
FooPromise.foo = function(arg) {
return this.then( function(result) {
return result.foo(arg);
});
};
var client = restl('http://192.168.0.21:3009/', options);
var home = client.getResource();
home.follow('currentUser')
.then(function(currentUser) {
return currentUser.follow('accounts')
})
.then(function(accounts) {
return accounts.get();
})
.then(function(result) {
console.log(result);
})
.catch(function(err) {
console.log(err);
});
var test = new FooPromise(function(res, rej) {
res('bla');
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc