rfc-to-bib
Version:
A library and CLI tool to generate BibTeX records for IETF RFCs.
18 lines (14 loc) • 445 B
JavaScript
;
/**
* Fetch the BibXML for an RFC.
*
* @param {Number} rfc - The RFC to fetch BibXML for.
* @returns {Promise} - A promise which delivers the RFC BibXML.
*/
module.exports = function (rfc) {
const got = require('got');
const sprintf = require('sprintf-js').sprintf;
const template = 'https://www.rfc-editor.org/refs/bibxml/reference.RFC.%04d.xml'
const url = sprintf(template, rfc);
return got(url);
};