
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
Rewrite all css url property asynchronously.
works with async functions (node 7.6+)
const fs = require('fs')
const base64Img = require('base64-img')
const cssReurl = require('css-reurl')
fs.readFile('test.css', (err, input_css) => {
cssReurl(input_css, url => {
return new Promise((resolve, reject) => {
base64Img.base64(url, (err, newurl) => {
if (data === void 0){
resolve(url)
}
resolve(newurl)
})
})
}, output_css => {
console.log(output_css)
})
})
cssReurl(src, fn, done)src<string|buffer> css source
fn(url)<function> return the newurl, or a promise resolves the newurl
done(newcss)<function> rewrote callback with the new source
cssReurl(src, url => {
return url + "abc"
}, done)
// asynchronously
cssReurl(src, url => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(url + "abc")
}, 1000)
})
}, done)
FAQs
rewrite css url asynchronous
We found that css-reurl 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.