robots-txt-parse
Advanced tools
Comparing version 0.0.4 to 1.0.0
@@ -32,2 +32,3 @@ 'use strict'; | ||
case 'disallow': | ||
case 'noindex': | ||
return { | ||
@@ -34,0 +35,0 @@ type: GROUP_MEMBER, |
{ | ||
"name": "robots-txt-parse", | ||
"version": "0.0.4", | ||
"version": "1.0.0", | ||
"description": "Streaming parser for robots.txt files", | ||
"main": "lib/parse.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Woorank/robots-txt-parse" | ||
}, | ||
"scripts": { | ||
"test": "mocha -R spec ./test", | ||
"test-watch": "mocha -w -R spec ./test" | ||
"test-watch": "mocha -w -R spec ./test", | ||
"version": "echo $npm_package_version" | ||
}, | ||
@@ -10,0 +15,0 @@ "author": "Jan Potoms", |
@@ -14,3 +14,2 @@ /*global describe, it*/ | ||
stream = fs.createReadStream(fixturePath); | ||
stream.pause(); | ||
return stream; | ||
@@ -21,3 +20,3 @@ } | ||
describe('parser', function () { | ||
it('should parse a simple group', function (done) { | ||
@@ -32,3 +31,3 @@ parse(getFixture('single-group')) | ||
assert.isObject(group); | ||
assert.property(group, 'agents'); | ||
@@ -38,3 +37,3 @@ assert.isArray(group.agents); | ||
assert.strictEqual(group.agents[0], '*'); | ||
assert.property(group, 'rules'); | ||
@@ -44,7 +43,7 @@ assert.isArray(group.rules); | ||
var rule = group.rules[0]; | ||
assert.isObject(rule); | ||
assert.propertyVal(rule, 'rule', 'disallow'); | ||
assert.propertyVal(rule, 'path', '/'); | ||
done(); | ||
@@ -54,3 +53,3 @@ }) | ||
}); | ||
it('should parse multiple agents', function (done) { | ||
@@ -62,3 +61,3 @@ parse(getFixture('multiple-agents')) | ||
assert.deepPropertyVal(parsed, 'groups[0].agents[2]', 'agent2'); | ||
done(); | ||
@@ -68,3 +67,3 @@ }) | ||
}); | ||
it('should ignore group members outside of a group', function (done) { | ||
@@ -75,3 +74,3 @@ parse(getFixture('member-outside')) | ||
assert.lengthOf(parsed.groups[0].agents, 1); | ||
done(); | ||
@@ -81,3 +80,3 @@ }) | ||
}); | ||
it('should parse extensions', function (done) { | ||
@@ -94,3 +93,3 @@ parse(getFixture('with-sitemap')) | ||
}); | ||
it('should parse multiple groups', function (done) { | ||
@@ -113,3 +112,3 @@ parse(getFixture('multiple-groups')) | ||
assert.deepPropertyVal(parsed, 'groups[2].rules[0].path', '/path3'); | ||
done(); | ||
@@ -119,3 +118,24 @@ }) | ||
}); | ||
it('should parse noindex', function (done) { | ||
parse(getFixture('noindex')) | ||
.then(function (parsed) { | ||
assert.deepPropertyVal(parsed, 'groups[0].agents[0]', '*'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[0].rule', 'allow'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[0].path', '/path1'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[1].rule', 'disallow'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[1].path', '/*/path2/'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[2].rule', 'noindex'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[2].path', '/*/path2/'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[3].rule', 'noindex'); | ||
assert.deepPropertyVal(parsed, 'groups[0].rules[3].path', '/*/path3/'); | ||
done(); | ||
}) | ||
.catch(done); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10794
195
1
1
1