exploitsearch.js

A Node.js library for accessing the Exploitsearch.net site API.

## Use
const search = require('exploitsearch');
const opts = {
timeout: 10000,
exploits: true,
};
search('freepbx', opts, (err, res) => {
if (err) {
console.log('Error:');
console.log(err);
process.exit(1);
} else {
console.log('Response:');
console.log(res);
}
});
search('asterisk', opts)
.then(res => {
console.log('Response (promise):');
console.log(res);
})
.catch(err => {
console.log('Error (promise):');
console.log(err);
process.exit(1);
});
More examples are included in the tests folder.
API
If the callback is ommited a promise is returned.
search(queryString, opts, callback)
Make a request to the API.
queryString
(String): The string to make the search.
opts
(Object): The options of the method:
exploits
- Only return vulnerabilities with public exploits. (default: false)
timeout
(number): Time to wait for a response. (default: 5000)
callback
- We follow the Error-first callback paradigm.
Developer guide
- Start coding with one of the actual modules similar to the new one as a boilerplate.
- Use GitHub pull requests.
Conventions:
- We use ESLint and Airbnb style guide.
- Please run to be sure your code fits with it and the tests keep passing:
npm run-script cont-int
Commit messages rules:
- It should be formed by a one-line subject, followed by one line of white space. Followed by one or more descriptive paragraphs, each separated by one line of white space. All of them finished by a dot.
- If it fixes an issue, it should include a reference to the issue ID in the first line of the commit.
- It should provide enough information for a reviewer to understand the changes and their relation to the rest of the code.