fastify-env
Advanced tools
Comparing version 2.1.0 to 2.1.1
import { EnvSchemaOpt } from "env-schema"; | ||
import { FastifyPlugin } from "fastify"; | ||
export type fasitfyEnvOpt = EnvSchemaOpt & { confKey?: string} | ||
export type fastifyEnvOpt = EnvSchemaOpt & { confKey?: string} | ||
export const fasitfyEnv: FastifyPlugin<fasitfyEnvOpt>; | ||
export default fasitfyEnv; | ||
export const fastifyEnv: FastifyPlugin<fastifyEnvOpt>; | ||
export default fastifyEnv; |
{ | ||
"name": "fastify-env", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Fastify plugin to check environment variables", | ||
"main": "index.js", | ||
"scripts": { | ||
"coverage": "cross-env VALUE_FROM_ENV=pippo tap --cov --coverage-report=html test/*.js", | ||
"lint": "standard | snazzy", | ||
"lint:fix": "standard --fix", | ||
"unit": "cross-env VALUE_FROM_ENV=pippo tap test/*.js", | ||
"test": "npm run lint && npm run unit && npm run typescript", | ||
"coverage": "cross-env VALUE_FROM_ENV=pippo tap --cov --coverage-report=html test/*.js", | ||
"typescript": "tsd" | ||
"typescript": "tsd", | ||
"unit": "cross-env VALUE_FROM_ENV=pippo tap test/*.js" | ||
}, | ||
@@ -28,14 +28,14 @@ "repository": { | ||
"dependencies": { | ||
"env-schema": "^2.0.0", | ||
"fastify-plugin": "^2.0.0" | ||
"env-schema": "^3.0.1", | ||
"fastify-plugin": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^14.11.8", | ||
"@types/node": "^15.0.0", | ||
"cross-env": "^7.0.2", | ||
"fastify": "^3.0.0", | ||
"pre-commit": "^1.2.2", | ||
"snazzy": "^8.0.0", | ||
"standard": "^14.0.2", | ||
"tap": "^14.10.7", | ||
"tsd": "^0.13.1" | ||
"snazzy": "^9.0.0", | ||
"standard": "^16.0.3", | ||
"tap": "^15.0.0", | ||
"tsd": "^0.14.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "tsd": { |
# fastify-env | ||
![CI workflow](https://github.com/fastify/fastify-env/workflows/CI%20workflow/badge.svg) | ||
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
![CI](https://github.com/fastify/fastify-env/workflows/CI/badge.svg) | ||
[![NPM version](https://img.shields.io/npm/v/fastify-env.svg?style=flat)](https://www.npmjs.com/package/fastify-env) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-env/badge.svg)](https://snyk.io/test/github/fastify/fastify-env) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) | ||
Fastify plugin to check environment variables | ||
@@ -46,3 +49,4 @@ | ||
This module is a wrapper around [env-schema](https://www.npmjs.com/package/env-schema) so, to read `.env` file you must set the `dotenv` in options: | ||
This module is a wrapper around [env-schema](https://www.npmjs.com/package/env-schema). | ||
To read an `.env` file you must set `dotenv` in the options: | ||
@@ -64,6 +68,6 @@ ```js | ||
**NB:** internally this plugin force to not have additional properties, so the `additionalProperties` flag is forced to be `false` | ||
**NB** Support for additional properties in the schema is disabled for this plugin, with the `additionalProperties` flag set to `false` internally. | ||
### Typescript | ||
In order to have typing for the fastify instance, you should follow the example below. | ||
In order to have typing for the fastify instance, you should follow the example below: | ||
@@ -70,0 +74,0 @@ ```typescript |
'use strict' | ||
const t = require('tap') | ||
const path = require('path') | ||
const Fastify = require('fastify') | ||
@@ -212,3 +213,3 @@ const fastifyEnv = require('../index') | ||
isOk: true, | ||
dotenv: { path: `${__dirname}/.env` }, | ||
dotenv: { path: path.join(__dirname, '.env') }, | ||
confExpected: { | ||
@@ -215,0 +216,0 @@ VALUE_FROM_DOTENV: 'look ma' |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12733
11
324
86
1
+ Addedajv@8.17.1(transitive)
+ Addeddotenv@11.0.0(transitive)
+ Addedenv-schema@3.5.2(transitive)
+ Addedfast-uri@3.0.3(transitive)
+ Addedfastify-plugin@3.0.1(transitive)
+ Addedjson-schema-traverse@1.0.0(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
- Removedajv@6.12.6(transitive)
- Removeddotenv@8.6.0(transitive)
- Removedenv-schema@2.1.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedfastify-plugin@2.3.4(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedsemver@7.6.3(transitive)
- Removeduri-js@4.4.1(transitive)
Updatedenv-schema@^3.0.1
Updatedfastify-plugin@^3.0.0