Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
easy-generator
Advanced tools
A simple template generator that combs through a template directory (templateDir
) and will compile all files via handlebars
. The files are then written to the provided output directory (outputDir
).
npm install --save easy-generator
const gen = require('easy-generator');
const outputDir = '/Users/SOME_USER/Desktop/temp';
const templateDir = './TEMPLATE_DIR';
// `data` is passed to every file in the templateDir for handlebars compilation
const data = {
name: 'Mark',
nodeVersion: '7.7',
};
gen({ outputDir, templateDir, data })
.then(() => {
console.log('✅ Generated ✅');
process.exit(0);
})
.catch(error => {
console.error(error);
console.error(`❌ FAILED to generate ❌`);
process.exit(1);
});
#! /usr/bin/env node
'use strict';
const Promise = require('bluebird');
global.Promise = Promise;
const Inquirer = require('inquirer');
const Path = require('path');
const program = require('commander');
const gen = require('easy-generator');
const Questions = [{
type: 'input',
name: 'name',
message: 'What is the name of your site?',
}, {
type: 'input',
name: 'description',
message: 'Site\'s description?',
}, {
type: 'input',
name: 'version',
message: 'Site\'s version?',
}, {
type: 'input',
name: 'author',
message: 'Site author?',
}, {
type: 'input',
name: 'nodeVersion',
message: 'What node version are you using?',
default: '7.7',
}];
const outputDir = Path.join(process.cwd(), name);
const templateDir = '/SOME/PATH/TO/TEMPLATE/DIR';
Inquirer.prompt(questions(name))
.then(answers => {
const data = answers;
return gen({ templateDir, outputDir, data });
})
.then(() => {
console.log('✅ Generated ✅');
process.exit(0);
})
.catch(error => {
console.error(error);
console.error(`❌ FAILED to generate ❌`);
process.exit(1);
});
FAQs
A simple template generator that utilizes handlebars
We found that easy-generator 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.