Skip to main content
Version: 4.0.0-preview

Providers

ExpressoTS providers are npm packages that drop pluggable functionality into your app: auth strategies, database adapters, log transports, message queues, and more. The CLI gives you three commands to work with them:

CommandPurpose
addInstall an existing provider into the current project.
removeUninstall a provider.
createScaffold a new provider package from the official provider template.

add

Install an ExpressoTS provider (or any npm package) into the current project.

expressots add <provider> [version]
FlagAliasDefaultDescription
--version <range>-vlatestExplicit version range (e.g. ^4.1.0, 4.0.0-beta.1).
--dev-dfalseInstall as a devDependency.

The CLI detects the active package manager from your project's lockfile:

Lockfile presentPackage manager used
package-lock.jsonnpm
yarn.lockyarn
pnpm-lock.yamlpnpm

If no lockfile is present, add falls back to npm.

Examples

# Install the latest version
expressots add @expressots/provider-jwt

# Install a specific version range
expressots add @expressots/provider-jwt --version "^4.0.0"

# Install as a dev dependency
expressots add @expressots/provider-fake-mailer --dev
Watch for the provider App Store

The provider catalogue is curated at expressots/providers. expressots add works with any npm package, but ExpressoTS-aware providers ship with idiomatic @provide() bindings and DI tokens.

remove

Uninstall a provider.

expressots remove <provider>

Like add, the CLI uses the package manager detected from your lockfile.

expressots remove @expressots/provider-jwt

create

Scaffold a brand-new provider package: a standalone npm-publishable library that follows the ExpressoTS provider conventions (dual CJS/ESM, lib/ output, GitHub workflows, husky hooks, Jest test scaffold).

expressots create <provider-name>
# or
expressots create --provider <provider-name>

create clones the expressots/templates/provider#v4.0.0 tree via degit into a folder named after the provider, and rewrites package.json name. It does not run npm install. That's your call.

After create

expressots create expressots-provider-redis
cd expressots-provider-redis
npm install

The starter ships with:

  • src/index.ts: empty barrel, ready for export * from "./your-provider".
  • src/your-provider.ts: @provide(YourProvider) class with health/metrics/configurable capability hooks.
  • tsconfig.json + tsconfig.build.json: TypeScript ESM + CJS dual-build setup.
  • test/example.spec.ts: Jest scaffold.
  • .github/workflows/*: release + CI jobs.
  • scripts/: release helpers.

Build, test, and publish with the usual npm workflow:

npm run build
npm test
npm publish --access public

See also