node-ifttt-maker
Advanced tools
Comparing version 0.1.2 to 1.0.0
@@ -1,2 +0,1 @@ | ||
'use strict'; | ||
/* | ||
@@ -6,11 +5,9 @@ * node-ifttt-maker | ||
* | ||
* Copyright (c) 2015 Jelte Lagendijk | ||
* Copyright (c) 2017 Jelte Lagendijk | ||
* Licensed under the MIT license. | ||
*/ | ||
/** | ||
* Export Node IFTTT Maker | ||
*/ | ||
module.exports = require('./lib/node-ifttt-maker'); | ||
exports = module.exports = require('./bin/node-ifttt-maker'); | ||
exports = module.exports; | ||
@@ -17,0 +14,0 @@ /** |
{ | ||
"name": "node-ifttt-maker", | ||
"version": "0.1.2", | ||
"version": "1.0.0", | ||
"description": "NodeJS module that will connect with the IFTTT maker channel", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "./node_modules/mocha/bin/mocha test/*.js", | ||
"cover": "istanbul cover _mocha", | ||
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls" | ||
}, | ||
@@ -18,7 +20,7 @@ "keywords": [ | ||
"engines": { | ||
"node": "^0.12" | ||
"node": ">= 6.9.1" | ||
}, | ||
"readmeFilename": "README.md", | ||
"author": { | ||
"name": "J.W. Lagendijk", | ||
"name": "j3lte", | ||
"email": "jwlagendijk@gmail.com" | ||
@@ -28,4 +30,20 @@ }, | ||
"dependencies": { | ||
"request": "^2.69.0" | ||
"promise": "^7.3.0", | ||
"request": "^2.81.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.2", | ||
"chai-as-promised": "^7.0.0", | ||
"coveralls": "^2.13.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^15.0.1", | ||
"eslint-plugin-import": "^2.3.0", | ||
"eslint-plugin-jsx-a11y": "^5.0.3", | ||
"eslint-plugin-mocha": "^4.10.1", | ||
"eslint-plugin-react": "^7.1.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.4.2", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"nock": "^9.0.13" | ||
} | ||
} |
@@ -6,10 +6,10 @@ node-ifttt-maker | ||
[](https://travis-ci.org/j3lte/node-ifttt-maker) | ||
[](https://david-dm.org/j3lte/node-ifttt-maker) | ||
[](http://badge.fury.io/js/node-ifttt-maker) | ||
[](https://david-dm.org/j3lte/node-ifttt-maker#info=devDependencies) | ||
[](https://codeclimate.com/github/j3lte/node-ifttt-maker) | ||
NodeJS module that will connect with the [IFTTT maker channel](https://ifttt.com/maker) | ||
A simple wrapper that will connect with the [IFTTT maker channel](https://ifttt.com/maker) | ||
It is a simple wrapper for using the Maker channel in IFTTT | ||
**This is work-in-progress, will build the next version with promises/event emitter** | ||
## Usage | ||
@@ -19,20 +19,41 @@ | ||
```js | ||
var IFTTT = require('node-ifttt-maker'), | ||
ifttt = new IFTTT('<YOUR MAKER KEY>'); | ||
const IFTTT = require('node-ifttt-maker'); | ||
const ifttt = new IFTTT('<YOUR MAKER KEY>'); | ||
ifttt.request({ | ||
event: 'event', | ||
method: 'GET', | ||
params: { | ||
'value1': 'test', | ||
'value2': 2, | ||
'value3': { | ||
x: 1, y: 2 | ||
} | ||
const event = 'eventname'; | ||
// Simple request | ||
ifttt | ||
.request(event) | ||
.then((response) => {}) | ||
.catch((err) => {}); | ||
// Using POST | ||
const method = 'POST'; | ||
ifttt | ||
.request({ event, method }) | ||
.then((response) => {}) | ||
.catch((err) => {}); | ||
// Adding values (only value1, value2 and value3 are accepted by IFTTT) | ||
const params = { | ||
'value1': 'test', | ||
'value2': 2, | ||
'value3': { | ||
x: 1, y: 2 | ||
} | ||
}, function (err) { | ||
} | ||
ifttt | ||
.request({ event, params }) | ||
.then((response) => {}) | ||
.catch((err) => {}); | ||
// The 'old' way of calling Maker using a callback still works | ||
ifttt.request(event, (err, body) { | ||
if (err) { | ||
console.log(err); | ||
} else { | ||
console.log('OK'); | ||
console.log(body); | ||
} | ||
@@ -50,3 +71,3 @@ }); | ||
Copyright (c) 2015 Jelte Lagendijk <jwlagendijk@gmail.com> | ||
Copyright (c) 2017 Jelte Lagendijk <jwlagendijk@gmail.com> | ||
@@ -53,0 +74,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
63195
7
68
1
76
2
13
+ Addedpromise@^7.3.0
+ Addedasap@2.0.6(transitive)
+ Addedpromise@7.3.1(transitive)
Updatedrequest@^2.81.0