From 5619191a004213289dcad2acfc5c1b03a269beb9 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Wed, 15 Apr 2020 10:34:47 +0200 Subject: [PATCH] add documentation --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index cbb9377..d5bc225 100644 --- a/README.md +++ b/README.md @@ -31,30 +31,30 @@ With code const scraper = require('deblan-scraper') const options = { - url: 'https://github.com/foo/bar', - acceptAllStatus: false, // Optional - method: 'GET', // Optional + url: 'https://github.com/foo/bar', + acceptAllStatus: false, // Optional, default is `false` + method: 'GET', // Optional, default is `GET` } const selector = '.repository-content .numbers-summary li:nth-child(4) a' const filters = { - tags: null, - breaks: null, - spaces: null, - trim: null, + tags: null, // Removes tags. You can specify the tags to remove (separated by comma) + breaks: null, // Removes breaks (\n, \r) + spaces: null, // Replaces 2 successive spaces by 1, except breaks + trim: null, // Strips whitespaces from the beginning and end of the value } scraper( - options, - selector, - filters, - function(value) { - console.log(value) - }, - function(error) { - console.log(error) - } + options, + selector, + filters, + function(value) { + console.log(value) + }, + function(error) { + console.log(error) + } ) ```