Skip to content

jacobrdale/urlmod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

httpsurlasmodule

Import JavaScript modules directly from HTTPS URLs in Node.js with ease.


Features

  • 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)

Installation

npm install httpsurlasmodule

Usage

import { importFromUrl } from "httpsurlasmodule";

async function main() {
  const mod = await importFromUrl("https://example.com/my-module.js");
  mod.doSomething();
}

main();

Constants

You can also import useful constants from the package:

import { DEFAULT_HEADERS, SUPPORTED_PROTOCOLS } from "httpsurlasmodule/constants";

console.log(DEFAULT_HEADERS);

Development

git clone https://github.com/jacobrdale/urlmod.git
cd urlmod
npm install
npm test

License

MIT © Jacob R. Dale


Repository

https://github.com/jacobrdale/urlmod

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published