Import JavaScript modules directly from HTTPS URLs in Node.js with ease.
- Dynamically import JavaScript modules from any HTTPS URL
- Simple API with
importFromUrl(url)function - Includes useful constants for HTTP headers, supported protocols, and caching
- Lightweight and zero dependencies
- Ready for modern Node.js environments (ES Modules)
npm install httpsurlasmoduleimport { importFromUrl } from "httpsurlasmodule";
async function main() {
const mod = await importFromUrl("https://example.com/my-module.js");
mod.doSomething();
}
main();You can also import useful constants from the package:
import { DEFAULT_HEADERS, SUPPORTED_PROTOCOLS } from "httpsurlasmodule/constants";
console.log(DEFAULT_HEADERS);git clone https://github.com/jacobrdale/urlmod.git
cd urlmod
npm install
npm testMIT © Jacob R. Dale