1.0.4 • Published 4 years ago

security-txt-node-parser v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

security.txt Node Parser

npm.io npm.io

parsing security.txt documents, zero dependencies, based on draft-foudil-securitytxt-09

Installing

npm install security-txt-node-parser

Example

const parseSecurityTxt = require('security-txt-node-parser').default

const securityTxt = await fetch('https://securitytxt.org/.well-known/security.txt')
	.then(resp => resp.text())
	.then(text => parseSecurityTxt(text))

console.log(securityTxt.contact[0]) // https://hackerone.com/ed

Options

These options are avaliable

parseSecurityTxt(document, {
	strict: true,
	parseUrls: true,
	parseDates: true
})
propertydefaultdescription
strictfalseif strict is true, an error will be thrown if the document is invalid
parseUrlsfalseif parseUrls is true, any urls will be wrapped in the URL object
parseDatesfalseif parseDates is true, any dates will be wrapped in the Date object

Licence

This project is licensed under the MIT License - see the LICENSE file for details

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago