Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-env

Package Overview
Dependencies
Maintainers
18
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-env - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

.github/dependabot.yml

6

index.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc