![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Eventual ES5 array operations using promises
$ npm install avec
Think of it like using native ES5 Array.prototype methods on Promised arrays.
var documents = getPromisedArrayOfStuffFromDB()
avec(documents).forEach(function (document) {
console.dir(document)
})
avec(documents)
.filter(x)
.map(x)
.reduce(x)
.then(function (aggregate) {
console.log('we can string things together')
// the neat thing about promises is that there's no `value()`
// or finalizer method to call, since each step of the way
// returns a valid promises/a `thenable` promise.
})
avec(promisedCollection)
Begins a promise chain.
forEach
, filter
, map
, reduce
, reduceRight
, every
,
some
, concat
, reverse
, sort
, indexOf
, lastIndexOf
,
shift
, unshift
, pop
, push
, slice
, splice
The return value for each of these is the a Promise of whatever the return value would be on a synchronous array.
avec(promise, continuation)
like calling promise.then(continuation)
, except continuation
's this
is also set to the promise value. This allows for slightly more fluid syntax:
var document = getDocumentAsPromise(5)
avec(document, function () {
console.log('We got ' + this.title)
})
This is pretty much an ergonomic function I wanted when writing scripts.
avec.each(promisedArray, iterator)
, alias avec.chaque
, avec.forEach
Like calling promise.then(function (val) { val.forEach(iterator) })
, Use when you're expecting an array value that you want to iterate over.
avec.map(promisedArray, scalarFunction
Like calling promise.then(function (val) { return val.map(scalarFunction) })
. Returns a Promise
In package root directory:
$ npm install
$ npm test
jden jason@denizac.org
MIT. (c) 2013 Agile Diagnosis hello@agilediagnosis.com See LICENSE.md
FAQs
Eventual ES5 array operations using promises
The npm package avec receives a total of 0 weekly downloads. As such, avec popularity was classified as not popular.
We found that avec demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.