1.0.3 • Published 6 years ago

shopback-assignment-seolint v1.0.3

Weekly downloads
16
License
-
Repository
github
Last release
6 years ago

shopback-assignment-seolint

Installation

npm install shopback-assignment-seolint

API

Detect SEO defects

Read from file, write to file

const seolint = require('shopback-assignment-seolint');
seolint.detector().read('test.html').write('output.txt');

Read from readable stream, write to writable stream

const fs = require('fs');
const seolint = require('shopback-assignment-seolint');
seolint.detector().read(fs.createReadStream('test.html')).write(fs.createWriteStream('output.txt'));

Read from file, write to console

const seolint = require('shopback-assignment-seolint');
seolint.detector().read('test.html').write(console);

Add a new rule

let detector = seolint.detector();
let rule = detector.ruleManager.create('meta').attr('name', 'robots').parentNode('head').moreThan(0);
detector.ruleManager.add(rule);

With custom summary

let detector = seolint.detector();
let rule = detector.ruleManager.create('meta').attr('name', 'robots').parentNode('head').moreThan(0, 'Be careful');
detector.ruleManager.add(rule);

Remove a rule

let detector = seolint.detector();
detector.ruleManager.remove('img[alt]');

Empty all rules

let detector = seolint.detector();
detector.ruleManager.empty();
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago