Registry /
web-framework / smash-middleware-helloworld
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import helloWorld from 'smash-middleware-helloworld'
✗ const helloWorld = require('smash-middleware-helloworld')
Package is ESM-only. No named exports.
helloWorld
✓ import helloWorld from 'smash-middleware-helloworld'
The default export is the middleware function.
type definition
✓ import helloWorld from 'smash-middleware-helloworld'; import type { Middleware } from 'smash-cli'
TypeScript users should import types from smash-cli, not from this package.
Demonstrates how to create a smash-cli app and add the hello world middleware.
import smash from 'smash-cli';
import helloWorld from 'smash-middleware-helloworld';
const app = smash();
app.use(helloWorld());
app.start();
Debug
Known issues
gotchaThis middleware requires smash-cli version >= 0.9.0. It will crash if used with older versions.fixInstall smash-cli@>=0.9.0.
affects: >=0.0.0
breakingVersion 0.0.20 changed the export from a factory function to a default export. Direct require or import destructuring will break.fixUse default import: import helloWorld from 'smash-middleware-helloworld'.
affects: >=0.0.20 <0.0.25
deprecatedThe 'init' method was deprecated in v0.0.10 and removed in v0.0.15. Use the constructor directly.fixReplace .init() with new middleware instance.
affects: >=0.0.10 <0.0.15
gotchaThe middleware does not export TypeScript type definitions. TypeScript users may see 'could not find a declaration file' errors.fixAdd a dummy declaration file: declare module 'smash-middleware-helloworld';
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'smash-middleware-helloworld'
Package not installed or not in NODE_PATH.
fixRun npm install smash-middleware-helloworld
TypeError: helloWorld is not a function
Using named import or destructured require instead of default import.
fixUse import helloWorld from 'smash-middleware-helloworld'
Uncaught SyntaxError: The requested module 'smash-middleware-helloworld' is expected to be of type CommonJS but is an ES module
Package is ESM-only, but project uses require() or outdated Node.js version.
fixUse import syntax or set "type": "module" in package.json. Node.js >=12 required.
Audit
Dependencies
No dependency data recorded yet.