Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

View File

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,15 @@
# trivial-deferred
The most dead-simple trivial Deferred implementation
Uses bluebird if available, otherwise native promises.
## USAGE
```js
var Deferred = require('trivial-deferred')
var d = new Deferred
// promise is d.promise
// to make the promise reject, do d.reject(error)
// to make the promise resolve, do d.resolve(value)
```

View File

@ -0,0 +1,24 @@
module.exports = Deferred
var P
/* istanbul ignore next */
try {
P = Promise
} catch (er) {
try {
P = require('bluebird')
} catch (er) {
throw new Error('this module requires a Promise implementation. ' +
'Try installing bluebird.')
}
}
function Deferred () {
this.resolve = null
this.reject = null
this.promise = new P(function (resolve, reject) {
this.reject = reject
this.resolve = resolve
}.bind(this))
}

View File

@ -0,0 +1,53 @@
{
"_from": "trivial-deferred@^1.0.1",
"_id": "trivial-deferred@1.0.1",
"_inBundle": false,
"_integrity": "sha1-N21NKdlR1jaKb3oK6FwvTV4GWPM=",
"_location": "/trivial-deferred",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "trivial-deferred@^1.0.1",
"name": "trivial-deferred",
"escapedName": "trivial-deferred",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/tap"
],
"_resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.0.1.tgz",
"_shasum": "376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3",
"_spec": "trivial-deferred@^1.0.1",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/tap",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"url": "http://blog.izs.me/"
},
"bugs": {
"url": "https://github.com/isaacs/trivial-deferred/issues"
},
"bundleDependencies": false,
"dependencies": {},
"deprecated": false,
"description": "The most dead-simple trivial Deferred implementation",
"devDependencies": {
"tap": "9||10"
},
"homepage": "https://github.com/isaacs/trivial-deferred#readme",
"keywords": [],
"license": "ISC",
"main": "index.js",
"name": "trivial-deferred",
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/trivial-deferred.git"
},
"scripts": {
"test": "tap test.js --100"
},
"version": "1.0.1"
}

View File

@ -0,0 +1,9 @@
var Deferred = require('./')
var assert = require('assert')
var d = new Deferred()
var t = require('tap')
t.match(d, {
resolve: Function,
reject: Function,
promise: Object
})