Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
Convenient and readability improving parameter binding for asynchronous JavaScript functions.
asca = require 'asca'
sayHi = asca (name, done) ->
console.log "Hello #{name}"
done()
sayHi
method behaves completely normal if called normally,
i.e. given all parameterssayHi 'world', -> #> "Hello world" & calls the given method when done
sayHi
method returns a method with all the given parameters bound to it.
This method can be called later by just giving it the callback.sayWorldLater = sayHi 'world' # 'sayWorldLater' is the sayHi method with
# the argument 'world' bound to it
sayWorldLater -> #> "Hello world" & calls the given method when done
# instead of this madness
async.parallel [
(done) -> sayHi 'world', done
(done) -> sayHi 'universe', done
]
# or this mess
async.parallel [
sayHi.bind this, 'world'
sayHi.bind this, 'universe'
]
# we can now say
async.parallel [
sayHi 'world'
sayHi 'universe'
]
Or in many other places that call a method later
# instead of
setTimeout (-> sayHi 'world'), 2000
# we can now say
setTimeout sayHi('world'), 2000
All asynchronous JavaScript methods should behave like this.
There are other libraries like curry that provide more comprehensive currying and binding, and might be more appropriate depending on what you want to do. This library is focussed around delayed asynchrounous function calling, performs error checking specifically for this use case, and does that with high performance while being extremely lightweight.
FAQs
Convenient parameter binding for asynchronous functions
The npm package asca receives a total of 10 weekly downloads. As such, asca popularity was classified as not popular.
We found that asca demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.