Registry / devops / mindbricks-api-face

mindbricks-api-face

JSON →
library1.0.23jsnpmunverified

An Express middleware and static asset generator for serving API documentation in Node.js and Next.js applications. The current stable version is 1.0.23, with releases following npm package publishing. It differentiates from other API doc tools by focusing on lightweight integration with Express and Next.js, providing a simple middleware that serves documentation from a provided configuration. It is TypeScript-first, shipping built-in types for a better developer experience.

npm install mindbricks-api-face
INSTALL
IMPORT
SIG · MINDBRICKS-API-FAC
M
mindbricks-api-face
devopsjavascriptv1.0.23
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import mindbricksApiFace from 'mindbricks-api-face'
const mindbricksApiFace = require('mindbricks-api-face')
ESM-only package; use import syntax in Node >=12 or with bundler.
middleware
import { middleware } from 'mindbricks-api-face'
Named export for the Express middleware function.
MindbricksApiFaceOptions
import type { MindbricksApiFaceOptions } from 'mindbricks-api-face'
import { MindbricksApiFaceOptions } from 'mindbricks-api-face'
TypeScript type import only; not available at runtime.

Demonstrates how to mount the Mindbricks API Face middleware on an Express app to serve API documentation from a JSON file.

import express from 'express'; import mindbricksApiFace from 'mindbricks-api-face'; const app = express(); const port = process.env.PORT ?? 3000; app.use('/api-docs', mindbricksApiFace({ docs: './docs.json' })); app.listen(port, () => { console.log(`Server running on port ${port}`); });
Debug
Known issues
breakingVersion 1.0.0 introduced an ESM-only build; CommonJS require() will fail.
fix
Use import syntax or update Node version to support ESM.
affects: >=1.0.0
gotchaThe middleware expects a JSON file path or object; passing an invalid path causes a silent failure.
fix
Ensure the docs path exists and is valid JSON, or pass the docs object directly.
affects: *
deprecatedThe option 'static' is deprecated; use 'staticAssets' instead.
fix
Rename 'static' to 'staticAssets' in configuration.
affects: >=1.0.20
gotchaThe middleware modifies the Express app's static assets; ensure it is mounted after body parsers.
fix
Mount mindbricksApiFace after express.json() or express.urlencoded().
affects: >=1.0.10
breakingSupport for Node.js <14 dropped in version 1.0.15.
fix
Update Node.js to version 14 or later.
affects: >=1.0.15
Errors
Common errors & fixes
Error: Cannot find module 'mindbricks-api-face'
Package not installed or not in node_modules.
fix
Run 'npm install mindbricks-api-face' to install.
SyntaxError: Unexpected token 'export'
Using CommonJS require() on an ESM-only package.
fix
Switch to import syntax or set type: 'module' in package.json.
TypeError: mindbricksApiFace is not a function
Default import used incorrectly; named import or wrong import syntax.
fix
Use 'import mindbricksApiFace from 'mindbricks-api-face'' or check for named exports.
Upgrade
Version history
1.0.23latest on npm
Audit
Dependencies
expressrequiredpeer dependency; required for the middleware to work
Agent activity
6 hits · last 30 days
node
6
Resources
mindbricks-api-face — npm install mindbricks-api-face · libregistry