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.
gulp-w3cjs
Advanced tools
Readme
First, install gulp-w3cjs
as a development dependency:
npm install --save-dev gulp-w3cjs
Then, add it to your gulpfile.js
:
var w3cjs = require('gulp-w3cjs');
gulp.task('w3cjs', function () {
return gulp.src('src/*.html')
.pipe(w3cjs())
.pipe(w3cjs.reporter());
});
The results are also added onto each file object under w3cjs
, containing success
(Boolean) and messages
(Array).
Example usage
var w3cjs = require('gulp-w3cjs');
var through2 = require('through2');
gulp.task('example', function () {
return gulp.src('src/*.html')
.pipe(w3cjs())
.pipe(through2.obj(function(file, enc, cb){
cb(null, file);
if (!file.w3cjs.success){
throw new Error('HTML validation error(s) found');
}
}));
});
Example output
HTML Error: index.html Line 5, Column 19: Element title must not be empty.
<title></title>
.../gulpfile.js:11
throw new Error('HTML validation error(s) found');
^
Error: HTML validation error(s) found
URL to the w3c validator. Use if you want to use a local validator. This is the
same thing as w3cjs.setW3cCheckUrl()
.
Http address of the proxy server if you are running behind a firewall, e.g. http://proxy:8080
options.doctype
and options.charset
were dropped in 1.0.0. Use 0.3.0 if you need them.
Default: false
Show info
type messages in the output.
Allows you to intercept info, warnings or errors, using options.verifyMessage
methed, returning false will skip the log output. Example usage:
return gulp.src('index.html')
.pipe(w3cjs({
verifyMessage: function(type, message) {
// prevent logging error message
if(message.indexOf('Element “style” not allowed as child of element') === 0) return false;
// allow message to pass through
return true;
}
}))
.pipe(w3cjs.reporter())
Same as options.url. SEt's the URL to the w3c validator.
FAQs
A Gulp wrapper for w3cjs to validate your HTML
The npm package gulp-w3cjs receives a total of 983 weekly downloads. As such, gulp-w3cjs popularity was classified as not popular.
We found that gulp-w3cjs 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.