This package has been deprecated

Author message:

this package has been deprecated, please sur @nuxtjs/dotenv instead

nuxtjs-dotenv-module

1.0.0 • Public • Published

nuxtjs-dotenv-module

npm (scoped with tag) npm CircleCI Codecov Dependencies

js-standard-style

A nuxt.js module that loads your .env file into your context options

📖 Release Notes

Features

The module loads variables from your .env file directly into your nuxt.js application context and process.env.

Setup

  • Add nuxtjs-dotenv-module dependency using yarn or npm to your project
  • Add nuxtjs-dotenv-module to modules section of nuxt.config.js
{
  modules: [
    // Simple usage
    'nuxtjs-dotenv-module',
 
    // With options
    ['nuxtjs-dotenv-module', { /* module options */ }],
 ]
}

Usage

After creating your .env file in the project root, simply run your usual npm run dev. The variable inside the .env file will be added to the context (context.env) and process (process.env)

if for some reason you want to restrict what's accessible into the context, you can can pass to the module options an only array with the keys you want to allow.

{
  modules: [
    ['nuxtjs-dotenv-module', {only: ['some_key']}],
  ]
}

License

MIT License

Copyright (c) Julien Tant julien@craftyx.fr

Readme

Keywords

none

Package Sidebar

Install

npm i nuxtjs-dotenv-module

Weekly Downloads

6

Version

1.0.0

License

MIT

Last publish

Collaborators

  • julientant