
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Custom Error
object
We hate errors, but we can not live without them.
Use err1st as an standard error object
Err = require 'err1st'
err = new Err('SOMETHING_WRONG')
throw err
Customize the error message
Err.meta
SOMETHING_WRONG:
status: 400
code: 100
message: (name) -> "something wrong, #{name}"
err = new Err 'SOMETHING_WRONG', 'Alice'
throw err ==> Err1st: "something wrong, Alice" ....
# With i18n locales
Err.localeMeta 'emoji',
SOMETHING_WRONG: (name) -> "🙅, #{name}"
...
Err.localeMeta 'en',
SOMETHING_WRONG: (name) -> "something wrong, #{name}"
err = new Err 'SOMETHING_WRONG', 'Bob'
console.log err.message ==> "🙅, Bob"
console.log err.locale('en').message ==> "something wrong, #{name}"
Combine meta and locales together
Err.meta
completed:
status: 400
code: 100
locales:
en: 'English'
zh: '中文'
flatten: [400100, { # Treat keys of object as language, except 'code', 'status', 'locales'
en: 'English',
zh: '中文'
}]
useFunction: [400100, {
en: -> 'English'
zh: -> '中文'
}]
meta
functionMIT
FAQs
Custom error object
The npm package err1st receives a total of 2 weekly downloads. As such, err1st popularity was classified as not popular.
We found that err1st 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.