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

makenv

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

makenv

A minimal module and CLI to make project environment configurations

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

makenv

A minimal module and CLI to make project environment configurations

Installing

# as a CLI
npm install -g makenv
# as a module
npm install --save-dev makenv

CLI

$ makenv

output

{
  "name": "awesome-project",
  "description": "Example description pulled from package.json",
  "homepage": "http://awesomeproject.com"
}

Use case

frontend.js

var appConfigurations = require('./env.json')

Module

var env = require('makenv')

output

{
  name: 'example',
  description: 'Example description pulled from package.json',
  homepage: 'http://example.com',
  mode: 'development',
  production: false,
  development: true,
  root: '/Users/johnsmith/awesome-project/',
  modules: [ 'node_modules', 'bower_components' ],
  paths: {
    api: 'api',
    components: 'components',
    images: 'images',
    providers: 'providers',
    public: 'public',
    scripts: 'scripts',
    styles: 'styles',
    views: 'views'
  }
}

Use case

gulpfile.js

var gulp = require('gulp')
var sass = require('gulp-sass')
var env = require('makenv')

gulp.task('sass', function () {
  return gulp.src( env.paths.styles + '/**/*.{sass,scss}')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest( env.paths.public ));
});
 
gulp.task('sass:watch', function () {
  gulp.watch(env.paths.styles + '/**/*.{sass,scss}', ['sass']);
});

webpack.config.js

var webpack = require('webpack')
var env = require('makenv')

module.exports = {
  debug: env.development ? true : false,
  devtool: env.development ? '#eval-source-map' : null,
  
  context: `${__dirname}/${env.paths.scripts}`,
  entry: env.development ? ['webpack-hot-middleware/client?reload=true', './'] : ['./'],
  output: {
    path: `${__dirname}/${env.paths.public} `
  },

  // allows to later require files from any location
  // var AwesomeComponent = require('components/AwesomeComponent')
  resolve: {
    extensions: ['', '.js','.jsx'],
    root: env.root,
    alias: env.paths,
    modulesDirectories: env.modulesDirectories
  },
  
  // ...
  
}

FAQs

Package last updated on 01 Jun 2016

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