Ghost/ghost/limit-service
Naz 73e7319406 Added optional max limit override to errorIfWouldGoOverLimit
refs https://github.com/TryGhost/Team/issues/587

- The optional {max} passed as an option allows to override currently configured limit and do a theoretical new limit check. For example:  check if the max limit will be exceeded if the limit changes (user changes plans)
2021-04-01 17:59:52 +13:00
..
lib Added optional max limit override to errorIfWouldGoOverLimit 2021-04-01 17:59:52 +13:00
test Added optional max limit override to errorIfWouldGoOverLimit 2021-04-01 17:59:52 +13:00
.eslintrc.js Added limit service initial commit 2021-03-03 12:19:48 +00:00
index.js Added limit service initial commit 2021-03-03 12:19:48 +00:00
LICENSE Added limit service initial commit 2021-03-03 12:19:48 +00:00
package.json Published new versions 2021-03-04 20:46:49 +00:00
README.md Updated readme with module description 2021-03-31 13:05:46 +13:00

Limit Service

This module is intended to hold all of the logic for testing if site:

  • would be over a given limit if they took an action (i.e. added one more thing, switched to a different limit)
  • if they are over a limit already
  • consistent error messages explaining why the limit has been reached

Install

npm install @tryghost/limit-service --save

or

yarn add @tryghost/limit-service

Usage

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

  • yarn dev

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2013-2021 Ghost Foundation - Released under the MIT license.