New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

confetti

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confetti - npm Package Compare versions

Comparing version 0.1.0 to 1.0.1

.circleci/config.yml

48

package.json
{
"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"
}
}

@@ -1,106 +0,3 @@

[![build status](https://secure.travis-ci.org/jharding/confetti.png)](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.
[![Confetti](https://circleci.com/gh/confetti/confetti-node.svg?style=shield)](https://circleci.com/gh/confetti/confetti-node)
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