Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@ladjs/shared-config

Package Overview
Dependencies
Maintainers
5
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ladjs/shared-config - npm Package Compare versions

Comparing version
7.0.3
to
8.0.0
+18
-1
index.js
const fs = require('fs');
const process = require('process');
const util = require('util');
const dayjs = require('dayjs-with-plugins');
const isSANB = require('is-string-and-not-blank');
const { boolean } = require('boolean');
const RATE_LIMIT_EXCEEDED = 'Rate limit exceeded, retry in %s.';
const TIMEOUT_MESSAGE =

@@ -50,2 +54,15 @@ 'Your request has timed out and we have been alerted of this issue. Please try again or contact us.';

: {
errorMessage(exp, ctx) {
const fn =
typeof ctx.request.t === 'function'
? ctx.request.t
: util.format;
return fn(
RATE_LIMIT_EXCEEDED,
dayjs()
.add(exp, 'ms')
.locale(ctx.state.locale || 'en')
.fromNow(true)
);
},
duration: process.env[`${prefix}_RATELIMIT_DURATION`]

@@ -56,3 +73,3 @@ ? Number.parseInt(process.env[`${prefix}_RATELIMIT_DURATION`], 10)

? Number.parseInt(process.env[`${prefix}_RATELIMIT_MAX`], 10)
: 100,
: 1000,
id: (ctx) => ctx.ip,

@@ -59,0 +76,0 @@ prefix: process.env[`${prefix}_RATELIMIT_PREFIX`]

+8
-47
{
"name": "@ladjs/shared-config",
"description": "Shared configuration for Lad's API and Web servers",
"version": "7.0.3",
"version": "8.0.0",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"ava": {
"serial": true,
"failFast": true,
"verbose": true
},
"bugs": {

@@ -15,7 +10,2 @@ "url": "https://github.com/ladjs/shared-config/issues",

},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"contributors": [

@@ -26,2 +16,4 @@ "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"

"boolean": "^3.2.0",
"dayjs": "^1.11.3",
"dayjs-with-plugins": "^1.0.2",
"is-string-and-not-blank": "^0.0.2"

@@ -33,3 +25,2 @@ },

"ava": "^4.2.0",
"codecov": "^3.8.2",
"cross-env": "^7.0.3",

@@ -47,3 +38,3 @@ "eslint": "^8.16.0",

"engines": {
"node": ">=8.3"
"node": ">=14"
},

@@ -62,27 +53,6 @@ "files": [

"license": "MIT",
"lint-staged": {
"*.js": [
"xo --fix"
],
"*.md": [
"remark . -qfo"
],
"package.json": [
"fixpack"
]
},
"main": "index.js",
"prettier": {
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
},
"publishConfig": {
"access": "public"
},
"remarkConfig": {
"plugins": [
"preset-github"
]
},
"repository": {

@@ -93,16 +63,7 @@ "type": "git",

"scripts": {
"ava": "cross-env NODE_ENV=test ava",
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "xo && remark . -qfo",
"nyc": "cross-env NODE_ENV=test nyc ava",
"test": "npm run lint && npm run ava",
"test-coverage": "npm run lint && npm run nyc"
},
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
"lint": "xo --fix && remark . -qfo && fixpack",
"prepare": "husky install",
"pretest": "npm run lint",
"test": "cross-env NODE_ENV=test nyc ava"
}
}
# [**@ladjs/shared-config**](https://github.com/ladjs/shared-config)
[![build status](https://img.shields.io/travis/ladjs/shared-config.svg)](https://travis-ci.com/ladjs/shared-config)
[![code coverage](https://img.shields.io/codecov/c/github/ladjs/shared-config.svg)](https://codecov.io/gh/ladjs/shared-config)
[![build status](https://github.com/ladjs/shared-config/actions/workflows/ci.yml/badge.svg)](https://github.com/ladjs/shared-config/actions/workflows/ci.yml)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)

@@ -30,9 +29,3 @@ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

[yarn][]:
```sh
yarn add @ladjs/shared-config
```
## Usage

@@ -61,3 +54,1 @@

[npm]: https://www.npmjs.com/
[yarn]: https://yarnpkg.com/