Skip to main content
Back to Dev generators

Dev

Générateur de modules JavaScript

Used by developers, writers, and creators worldwide.

A JavaScript module generator gives you a tidy ES module skeleton so a new file starts with structure instead of a blank screen. Name the module and list the functions it should export, and it returns modern JavaScript with a module-level JSDoc header and one exported async function per name, each with a JSDoc param and return annotation and a not-implemented guard that throws until you write the body. Names are normalised to camelCase so they are valid identifiers however you type them. Developers use it to scaffold a service module, keep export style consistent, and remember the JSDoc shape that powers autocompletion. It runs in your browser and generates instantly. Paste it into a .js or .mjs file, flesh out each function, and refine the JSDoc types. The throw-until-implemented stubs mean a half-finished module fails loudly rather than returning undefined by surprise.

Read the complete guide — 4 min read

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Name the module by its purpose.
  2. List the functions to export, separated by commas.
  3. Click Generate to build the module skeleton.
  4. Paste it into a .js or .mjs file and implement each function.

Use Cases

  • Scaffolding a new service or utility module
  • Keeping named-export style consistent across a project
  • Remembering the JSDoc shape for editor autocompletion
  • Stubbing functions that fail loudly until implemented
  • Teaching ES module structure to newer developers

Tips

  • Use named exports so consumers import exactly what they need.
  • Refine the JSDoc param and return types for better autocompletion.
  • Drop async on any function that is purely synchronous.
  • Keep one clear responsibility per module.

FAQ

why do the stubs throw an error

A function that throws "not implemented" makes an unfinished module fail loudly the moment it is called, instead of silently returning undefined and causing a confusing bug somewhere downstream. Replace the throw with real logic as you go.

why are the functions async

Most service and IO functions end up async, so the generator defaults to async and a Promise return type. If a function is purely synchronous, drop the async keyword and adjust the JSDoc return annotation.

how are the names cleaned up

Each name is normalised to camelCase and stripped of invalid characters so it is always a valid JavaScript identifier, whether you type snake_case, kebab-case, or spaces. The first export drives the module description.

You might also like

Popular tools from other categories that share themes with this one.