Skip to main content

ModuleJS file exports Code

Script

Code fragment run in Global Scope by Browser

CommonJS

(legacy) Module format (originally) for Servers (Node.js)

module.exports

Object to export from CommonJS, require() to import

require()

ES Module

(default) built-in JS module format

AMD Module

Async Module Definition format used in Browser

Loading Module Cycle

Module Specifier

string to identify & point to Module location

Dependency

extra external code that a project/Source Code depends on to work

Module File Extensions

Polyfill

Code to emulate native Web Platform feature for backwards compatibility with older Browser

Bundler

Dev tool to combine Modules into fewer file to optimize for Browser

import

JS Keyword Declaration to import live read-only views on exports

Browser Module Path

to import Module via Module Specifier to point to CDN URL link - to allow immediate Execution in Browser w/o Bundler

References

  1. npmPackage Manager CLI Dev tool to access/manage Module from npmjs

  2. assertNode.js Module to Unit Test validity of operations

  3. AssertionErrorError thrown by assert Module for failure of assertion

  4. CommonJS ↔ (legacy) Module format (originally) for Servers (Node.js)

  5. AMD ModuleAsync Module Definition format used in Browser

  6. Node API ↔ core Node.js internal Module built-in with Node.js

  7. keywords ↔ to set list of SEO keywords to search for Module on npmjs

  8. corsNode.js Module for CORS to open up API so accessible by other Domains

  9. body-parserNode.js Middleware Module to parse (URL/JSON-encoded) POST data

  10. wsNode.js Module to build WebSockets Server

  11. socket.ioNode.js Module to build WebSockets with built-in Server/Client & fallback Long Polling

  12. Module Instantiation ↔ Every Module visited to connect imports to exports ; must instantiate children before parents

  13. Module Evaluation ↔ Execute Module body; children evaluated before parents

  14. Module Import Cycle ↔ After parsing, Module are set up in 2 phases of Module Instantiation & Module Evaluation

  15. main ↔ sets Module file as entry point for Package - usually index.js

  16. Module Specifierstring to identify & point to Module location

  17. type ↔ to set Module type as either "CommonJS" or "Module"

  18. import()JS Operator to Dynamically load Module via Promise

  19. import.meta ↔ return Object with Metadata for current Module

  20. BundlerDev tool to combine Modules into fewer file to optimize for Browser

  21. import.meta.urlimport.meta property with URL string of current Module

  22. Module BundlerDev tool to combine Modules into single file

  23. Browser Module Path ↔ to import Module via Module Specifier to point to CDN URL link - to allow immediate Execution in Browser w/o Bundler

  24. devDependencies ↔ to list Module for dev build/test only & not prod ship

  25. dependencies ↔ to list Module to Bundle & prod ship

  26. yarn upgrade ↔ to update Module to their range set by internal package.json

  27. exportJS Keyword to export Module

  28. ViteDev tool to scaffold & build framework UI, next-gen ESBuild Bundler 100X Webpack perf, support native Module, native TS

  29. Low-Level APIAPI with more granular control over software Module or Hardware, with fewer Abstraction

  30. Hot Module Replacement ↔ (feat) to update Module in live App instance seamlessly