delete - nodef/extra-quotes GitHub Wiki

Deletes loaded / manually set quotes (from corpora).

quotes.delete(name);
// name: name of quote group (corpus)
// --> true, if removed
const quotes = require('extra-quotes');

await quotes.load('mahatma gandhi');
/* loads Mahatma Gandhi quotes from Wikiquote */

await quotes.load('arnold', {all: false});
/* loads only Arnold Schwarzenegger quotes from Wikiquote*/

await quotes.load();
/* loads local popular movie quotes */

quotes.corpora;
// Map {'Mahatma Gandhi' => quotes, 'Arnold Schwarzenegger' => quotes, '' => movie quotes}

quotes.delete('Arnold Schwarzenegger');
// true

quotes.corpora;
// Map {'Mahatma Gandhi' => quotes, '' => movie quotes}

quotes.delete('');
// true

quotes.corpora;
// Map {'Mahatma Gandhi' => quotes}

quotes('success');
// [ { text:
//      "Satan's successes are the greatest when he appears with the name of God on his lips.",
//     by: 'Mahatma Gandhi',
//     ref:
//      `"The Inwardness of Non-Co-operation". Quoted in Freedom's Battle: Being a Comprehensive Collection of Writings and Speeches (1922), p. 144.` } ]