UNPKG

url-metadata

Version:

Request a url and scrape the metadata from its HTML using Node.js or the browser.

13 lines (12 loc) 268 B
module.exports = function ( msg, statusCode, paymentRequired, x402 ) { const error = new Error(msg) if (statusCode) error.statusCode = statusCode if (paymentRequired) error.paymentRequired = paymentRequired if (x402) error.x402 = x402 return error }