Socket
Socket
Sign inDemoInstall

personapi

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

personapi - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

.npmignore

51

index.js
'use strict';
/**
* @param {number} number
* @param {string} locale
* @return {string}
*/
module.exports = function(token) {
console.log(token);//debug
var request = require("request");
module.exports = {
personapiUrl: "https://api.personapi.com",
token: "",
actions: {
registerUser: "/appuser/create"
},
init: function(token) {
this.token = token;
},
setServiceURL: function(url) {
if (url.trim() != "") {
this.personapiUrl = url;
}
},
registerUser: function(params) {
params.token = this.token;
return this._sendRequest(this.actions.registerUser, params);
},
_sendRequest: function(action, params) {
var url = this.personapiUrl;
return new Promise(function(fulfill, reject) {
var options = {
uri: url + action,
method: "POST",
json: params
};
request(options, function(error, response, body) {
if(error) {
reject(error);
} else {
fulfill(body);
}
});
});
}
};

7

package.json
{
"name": "personapi",
"version": "0.1.0",
"version": "0.1.1",
"description": "NPM module to easily access and use the functions provided by the PersonAPI platform",

@@ -19,3 +19,6 @@ "main": "index.js",

"license": "ISC",
"homepage": "https://bitbucket.org/suyash_sumaroo/personapi-npm#readme"
"homepage": "https://bitbucket.org/suyash_sumaroo/personapi-npm#readme",
"dependencies": {
"request": "^2.83.0"
}
}
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