Home Doh Ref
Dohballs
  • 📁 doh_modules
    • 📦 dataforge
    • 📦 express
    • 📁 sso
    • 📁 user

External Packages and Installation Strategy

Doh favors a zero-friction model: imports drive installation. All ESM imports are auto-installed at 'latest' unless pinned, and pinning is encouraged directly in the import specifier (e.g., "lodash@^4"). This co-locates version intent with usage and reduces boilerplate.

Doh.Install remains available for advanced cases (non-imported artifacts, legacy flows, scripts), but the recommended path is:

  • Use imports everywhere possible
  • Pin versions in import specifiers when you need stability
  • Fall back to Doh.Install for special cases

Doh.Install Function (Advanced)

For special cases where you need to declare dependencies outside of import statements, Doh.Install takes the form:

Doh.Install(module_name, install_instructions);
  • module_name: String identifying the module
  • install_instructions: Object or Array specifying npm packages to install

Installation Instructions Formats

Install instructions can be provided in multiple formats. Prefer pinned import specifiers in code; use these forms only when explicit control is required outside imports.

  1. As an object:
Doh.Install('my-module', {
  'npm:package-name': '^1.2.3',
  'npm:another-package': '~2.0.0'
});
  1. As an array:
Doh.Install('my-module', [
  'npm:package-name',
  'npm:another-package'
]);

Integration with Browser Files

Doh.Install can be included in browser-facing files, but its execution is server-side:

// This file can be loaded in the browser
Doh.Module('my-module', ['dependency1'], function() {
  // Browser-side module code
});

Doh.Install('my-module', {
  // installed on the server
  'npm:server-package': '^1.0.0'
});
Last updated: 8/23/2025