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.
bs-compile-middleware
Advanced tools
Readme
Compilation middleware for Browsersync
npm install --save-dev bs-compile-middleware
In case of the following configuration, if you request to http://localhost:3000/index.html
, bs-compile-middleware get path/to/src/index.pug
and compile it. Finally, the compiled html is returned from the Browsersync server.
const browserSync = require('browser-sync').create()
const compileMiddleware = require('bs-compile-middleware').compileMiddleware
// any preprocessor you want to use
const pug = require('pug')
browserSync({
server: true,
middleware: compileMiddleware({
srcDir: 'path/to/src',
compilers: [
{
// a requested extention you want to hook some compilations
reqExt: 'html',
// source file extention
srcExt: 'pug',
// you can compile a requested source file in compile hook
// It expects compiled data as return value
// src - Buffer of the source file
// filename - file name of the source
compile: (src, filename) => {
// example compiling pug
return pug.render(src.toString(), { filename })
}
}
]
})
})
Feel free to open issues and pull requests if you find any bugs, want to add any features or so on.
MIT
FAQs
Compilation middleware for Browsersync
The npm package bs-compile-middleware receives a total of 9 weekly downloads. As such, bs-compile-middleware popularity was classified as not popular.
We found that bs-compile-middleware 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
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.