![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
org.webjars.npm:sb-promisify
Advanced tools
A node module to help you convert callback-style functions to promises
npm install --save sb-promisify
function promisifyAll(object, throwError = true): Object
function promisify(callback, throwError = true): Function
export default promisify
export { promisify, promisifyAll }
import fs from 'fs'
import promisify from 'sb-promisify'
const readFile = promisify(fs.readFile)
readFile('/etc/passwd', 'utf8').then(function(contents) {
console.log(contents)
}, function() {
console.error('Unable to read file')
})
import fs from 'fs'
import { promisifyAll } from 'sb-promisify'
const promisedFS = promisifyAll(fs)
promisedFS.readFileAsync('/etc/passwd', 'utf8').then(function(contents) {
console.log(contents)
})
promisedFS.readFile('/etc/passwd', 'utf8', function(contents) {
console.log(contents)
})
If you set throwError to false, here's how it would react
'use babel'
import fs from 'fs'
import promisify from 'sb-promisify'
const access = promisify(fs.access, false)
const readFile = promisify(fs.readFile, false)
readFile('/etc/passwd').then(function(contents) {
if (contents === false) {
console.error('Unable to read file')
} else {
console.log(contents.toString('utf8'))
}
})
access('/etc/passwd').then(function(access) {
console.log('access', access) // true or false
})
This module is licensed under the terms of MIT License. Check the LICENSE file for more info.
FAQs
WebJar for sb-promisify
We found that org.webjars.npm:sb-promisify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.