Comparing version 0.1.0 to 1.0.1
{ | ||
"name": "confetti", | ||
"version": "0.1.0", | ||
"description": "Promise decorator built on top of rsvp.js.", | ||
"author": { | ||
"name": "Jake Harding", | ||
"email": "jacob.s.harding@gmail.com" | ||
}, | ||
"main": "lib/confetti.js", | ||
"dependencies": { | ||
"underscore": "~1.3" | ||
}, | ||
"devDependencies": { | ||
"promise-tests": "~2.0.0", | ||
"mocha": "~1.6.0", | ||
"sinon": "~1.5.0" | ||
}, | ||
"version": "1.0.1", | ||
"description": "A Node wrapper for the Confetti API.", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "./node_modules/promise-tests/lib/cli.js all ./test/promise_tests_adapter && ./node_modules/mocha/bin/mocha --reporter spec" | ||
"test": "mocha" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/jharding/confetti.git" | ||
"url": "git+https://github.com/confetti/confetti-node.git" | ||
}, | ||
"author": "Confetti", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jharding/confetti/issues" | ||
"url": "https://github.com/confetti/confetti-node/issues" | ||
}, | ||
"keywords": [ | ||
"promises", | ||
"futures", | ||
"events", | ||
"decorator" | ||
], | ||
"license": "MIT" | ||
"homepage": "https://github.com/confetti/confetti-node#readme", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"chai-as-promised": "^7.1.1", | ||
"mocha": "^7.0.1", | ||
"prettier": "1.19.1", | ||
"sinon": "^9.0.0", | ||
"sinon-chai": "^3.5.0" | ||
}, | ||
"dependencies": { | ||
"dotenv": "^8.2.0", | ||
"node-fetch": "^2.6.0", | ||
"qs": "^6.9.1", | ||
"yayson": "^2.0.10-quickfix" | ||
} | ||
} |
107
README.md
@@ -1,106 +0,3 @@ | ||
[](http://travis-ci.org/jharding/confetti) | ||
Confetti | ||
======== | ||
Hello Confetti API Wrapper 👋 | ||
Confetti is a promise decorator built on top of [rsvp.js](https://github.com/tildeio/rsvp.js). With Confetti, you can easily define promise constructors that have custom functions attached to the constructor's prototype. The custom functions get wrapped in a way that allows them to be called within the framework of promises. It's quite cool. | ||
The documentation for this project is lacking and I plan on adding much more thorough documentation as soon as I can. Until then, if you have any questions about Confetti, open up an issue or contact me through whatever means works for you. | ||
Installation | ||
------------ | ||
``` | ||
$ npm install confetti | ||
``` | ||
Usage | ||
----- | ||
### Require | ||
```javascript | ||
var confetti = require('confetti'); | ||
``` | ||
### API | ||
#### confetti.define(functions) | ||
Returns a promise constructor with each function contained in `functions` added to its prototype. Before being added to the constructor's prototype, each function contained in `functions` will be wrapped to work within the promise framework. | ||
### Async Functions | ||
Confetti works with both sync and async functions. In order to determine whether or not the function being dealt with is sync or async, Confetti relies on the function's signature. If the function's signature contains 1 more parameter then it's being called with, Confetti will assume the function is asynchronous and that the missing argument is the callback function. | ||
Note that Confetti is very picky about function signatures. Bad things will happen when the number of arguments a function is called with doesn't match up with the number of formal parameters. The one exception to this rule is for async functions. With async functions, you should omit the callback argument when calling them. | ||
### Example | ||
#### Code | ||
```javascript | ||
var confetti = require('confetti'); | ||
var Promise = confetti.define({ | ||
sync: function(adjective) { | ||
return 'Sync functions are ' + adjective + '!'; | ||
}, | ||
async: function(adjective, cb) { | ||
process.nextTick(function() { | ||
cb(null, 'Async functions are ' + adjective + '!'); | ||
}); | ||
} | ||
}); | ||
var promise = new Promise(); | ||
promise | ||
.async('hip') | ||
.value(function(result) { console.log(result); }) | ||
.sync('old school') | ||
.value(function(result) { console.log(result); }) | ||
.error(function(err) { console.log('error is bad'); }); | ||
promise.resolve(); | ||
``` | ||
#### Output | ||
``` | ||
Async functions are hip! | ||
Sync functions are old school! | ||
``` | ||
Testing | ||
------- | ||
``` | ||
$ cd confetti | ||
$ npm test | ||
``` | ||
Issues | ||
------ | ||
Found a bug? Create an issue on GitHub. | ||
https://github.com/jharding/confetti/issues | ||
Versioning | ||
---------- | ||
For transparency and insight into the release cycle, releases will be numbered with the follow format: | ||
`<major>.<minor>.<patch>` | ||
And constructed with the following guidelines: | ||
* Breaking backwards compatibility bumps the major | ||
* New additions without breaking backwards compatibility bumps the minor | ||
* Bug fixes and misc changes bump the patch | ||
For more information on semantic versioning, please visit http://semver.org/. | ||
License | ||
------- | ||
Copyright (c) 2012 [Jake Harding](http://thejakeharding.com) | ||
Licensed under the MIT License. | ||
[](https://circleci.com/gh/confetti/confetti-node) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
25112
37
834
0
0
4
6
4
4
18
+ Addeddotenv@^8.2.0
+ Addednode-fetch@^2.6.0
+ Addedqs@^6.9.1
+ Addedyayson@^2.0.10-quickfix
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddotenv@8.6.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedobject-inspect@1.13.4(transitive)
+ Addedq@1.5.1(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedunderscore@1.13.7(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedyayson@2.1.0(transitive)
- Removedunderscore@~1.3
- Removedunderscore@1.3.3(transitive)