
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
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
$ makenv
output
{
"name": "awesome-project",
"description": "Example description pulled from package.json",
"homepage": "http://awesomeproject.com"
}
frontend.js
var appConfigurations = require('./env.json')
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'
}
}
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
A minimal module and CLI to make project environment configurations
We found that makenv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.