Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@npm/spife

npm77ISCdeprecated12.3.0

no longer maintained

:curry: :knife_fork_plate: a jshttp based µframework :knife_fork_plate: :spaghetti:

jshttp, microframework, http

readme

:fork_and_knife: Spife :fork_and_knife:

Build Status Greenkeeper badge

Welcome to Spife! It cuts like a knife, but scoops like a spoon!

Spife is a jshttp-based microframework with Opinions (TM). Collects and curates the following packages:

  1. Routing, courtesy of reverse,
  2. Database access, courtesy of pg
  3. Per-request concurrency and transactions, courtesy of pg-db-session,
  4. An ORM, courtesy of ormnomnom,
  5. Metrics gathering, courtesy of numbat-emitter,
  6. Monitoring, a la restify-monitor,
  7. and Logging, courtesy of bole

API

Full docs are available here.

  1. If you're just getting started with Spife, you might try the tutorial!
  2. You might have some questions. Check the FAQ.
  3. The topic documentation lays out the high-level concepts.
  4. Reference documentation covers API signatures and methods.

:package: denotes a link to an external package that has been bundled with Spife.

Development

To develop locally, clone this repository, and run npm install in a shell in the repository directory. From there you can:

  • npm test: Run both the linter and the code tests.
  • npm run lint: Run just the linter.
  • npm run cov:test: Run the code tests with code coverage enabled.
  • npm run cov:html: Run the code tests and output a coverage directory. serve the directory at http://localhost:60888.

License

ISC

changelog

Change Log

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

12.2.7 (2019-07-29)

Bug Fixes

  • docs: Incorrect/non-public URL in docs (#106) (a808f0b)
  • properly forward errors in test db middleware (#121) (7006a2d), closes #119

12.2.4 (2018-11-16)

Bug Fixes

  • response metrics are counts, not gauges (#107) (bb23f24)

12.2.3 (2018-10-26)

Bug Fixes

  • make query metrics a count, fix body size/latency metrics (#99) (a24bb66)

12.2.2 (2018-10-19)

12.2.0 (2018-09-26)

Bug Fixes

Features

  • BUILD_HASH and BUILD_MESSAGE override git values in monitor (6f090d0)

12.0.2 (2018-09-11)

11.4.0 (2018-08-01)

Features

  • automatically handle JSON bodies in test requests (#91) (115557a)

11.2.5 (2018-07-26)

11.1.5 (2018-04-07)

11.0.0 (2018-01-23)

Features

  • ormnomnom has been updated! Bug fixes and better handling for edge cases included

BREAKING CHANGES

  • ormnomnom upgrade included an update to joi which is used throughout spife. This update included breaking changes to how dates were handled and how joi returns errors. If you were relying on html encoding coming from joi before, do not anymore

10.0.0 (2017-12-28)

Features

  • hot-reload: hot reload views, routes, and mw (da70d60)

Performance Improvements

BREAKING CHANGES

  • node 6 is unsupported
  • req.metric was removed.
  • Middleware can no longer be provided as a single function.
  • Update your middleware! next() now requires arguments to be passed to it. (e.g., in processRequest(req, next), one should call next(req)).

9.0.0 (2017-11-27)

Bug Fixes

  • dep: set ormnomnom at version that doesn't break node 6 (17a37ca)
  • versions: test on 8 & 9 (d1070bb)
  • Release rewritten body validator decorator (9c752a2)

Features

  • Rewritten validate body decorator (5d1c4a1)
  • Rewritten validate body decorator (085d622)
  • Rewritten validate body decorator (3859bdb)
  • Rewritten validate body decorator (1c486a3)

BREAKING CHANGES

  • Changes to the validate.body decorator signature

8.4.1 (2017-10-20)

Bug Fixes

  • yargs exits now if parse is run with no second argument (#44) (3bb0c5f)

8.0.0 (2017-08-23)

Bug Fixes

  • add 400 status to validation error, do not create new error (59546eb)
  • allow insecure csrf cookies in dev mode; regen csrf w/appropriate config (088e217)
  • default body parser had wrong method signature (#34) (3a739bf)
  • do not error out if a json response comes back with a ".pipe" member (5a2c739)
  • don't override connection until server bootstraps (#33) (4c342e0)
  • it helps to use the correct variable names (bdd6c09)
  • large responses were doing a timewarp (ed140c6)
  • logging middleware should return res (6987292)
  • make process metrics interval configurable (20c0f99)
  • no longer emit deprecation warnings on test (57da467)
  • table.default → table.table in show-query-metrics (3b50a03)
  • un-decorate() db.atomic/transaction (31ab5cb)
  • use @npm/decorate for decorators (893e6bc)
  • use variables that exist (cd02ff1)
  • csp: image-src is not a directive (47d1c90)
  • middleware: PR fixes for csp (c8cbfcd)

Features

  • add "spife init app" (d90cb8b)
  • add basic default Loader class (0a86318)
  • add litmus option to loader (5a3cceb)
  • add Server#uninstall(). (67599f0)
  • coerce middleware resps between execution (bcf473a)
  • rework middleware (ae79b07)
  • validate.{body,query} now call view on error (98884ce)
  • dep: add package-lock (d2b8e82)
  • middleware: CSP (92672db)
  • processBody: a new middleware lifetime! (653c54f)
  • test: add travis badge to readme (ce2ac59)

BREAKING CHANGES

  • Middleware cannot return a false-y value, or throw non-Error values.
  • Completely rework how middleware functions in Spife.

6.0.2 (2017-05-19)

Bug Fixes

  • do not error out if a json response comes back with a ".pipe" member (5a2c739)

6.0.0 (2017-05-18)

Bug Fixes

  • logging middleware should return res (6987292)

Features

  • coerce middleware resps between execution (bcf473a)
  • rework middleware (ae79b07)

BREAKING CHANGES

  • Middleware cannot return a false-y value, or throw non-Error values.
  • Completely rework how middleware functions in Spife.

5.0.0 (2017-04-28)

3.0.0-beta0 (2016-12-28)

dev deps bumps

ecstatic 1.4.0 -> 2.1.0 standard 5.4.1 -> 8.6.0 tap 5.0.1 -> 8.0.1

major bumps

format-link-header 1.0.0 -> 2.0.0 (using ES6 language features) numbat-emitter 2.3.2 -> 3.2.1 table 3.8.3 -> 4.0.1 (used by spife test metrics report) uuid 2.0.1 -> 3.0.1 (removed uuid parsing, which is not used by spife)

upgrades

numbat-process 2.0.7 -> 2.1.0 accepts 1.3.0 -> 1.3.3 bluebird 3.1.1 -> 3.4.7 ormnomnom 2.6.0 -> 2.7.0 percentile 1.1.0 -> 1.2.0 range-parser 1.0.3 -> 1.2.0 statuses 1.2.1 -> 1.3.1


2.3.0 (2016-09-02)

Features

  • reply.empty() now accepts optional status code (#4) (4a84fd0)

2.2.9 (2016-07-28)

Bug Fixes

  • we were pulling in the wrong joi (#3) (983b27a)