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

sails-js-hook-dotenv

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-js-hook-dotenv

Sails.js hook for loading .env files

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-27.78%
Maintainers
1
Weekly downloads
 
Created
Source

sails-js-hook-dotenv

Sails JS hook to load environment variables from a .env file using dotenv

Installation

npm install sails-hook-dotenv

Usage

Start sails as you normally do (sails lift) and you will be able to access your environment variables using process.env.your-variable-name

Configuration

You can add configuration options for this hook in config/dotenv.js by default. Currently, the only option is a boolean: active. Setting this to false will disable this hook.

module.exports.dotenv = {
  
  default: {
    
    /**
     * Setting this to false will disable this hook
     */
    active: true,

    /**
     * Setting this to false will cause the application 
     * NOT to throw an error if the config fails to load
     */
    throwOnFailure: true,
    
  }
  
}

Testing

Copy the .env.example file to create a new .env file.

Then run npm run test in your terminal.

Changelog

Changelog

Keywords

FAQs

Package last updated on 13 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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