New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cml-cli

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cml-cli - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

18

lib/generate.js

@@ -14,3 +14,7 @@ var chalk = require('chalk');

};
/**
* Generates files from templates
* @param {[type]} names Array of parameters, first is template type (element, fragment, module, page)
* @return {[type]}
*/
function generate(names) {

@@ -25,2 +29,3 @@ var type = names.shift();

var templates = {};
// go thru all extensions in type and cache templates
_.each(extensions, function(extension) {

@@ -30,4 +35,6 @@ var template = fs.readFileSync(path.join(sources, type + '.' + extension), 'utf-8');

});
// create template for each requested names and each extension type contains
_.each(names, function(name) {
_.each(extensions, function(extension) {
// template string + data for template
var data = templates[extension]({

@@ -39,3 +46,12 @@ partName: name,

});
// target path
var filePath = path.join(config.sourceDir, config.sourcePaths.viewsDir, pluralize(type), name, name + '.' + extension);
// ensure directories exists before saving template
filePath.split('/').slice(0, -1).reduce(function(prev, curr, i) {
if (fs.existsSync(prev) === false) {
fs.mkdirSync(prev);
}
return prev + '/' + curr;
});
// write file
fs.writeFileSync(filePath, data, 'utf-8');

@@ -42,0 +58,0 @@ console.log(chalk.green.bold('Success: ' + chalk.underline.white(filePath)));

2

package.json
{
"name": "cml-cli",
"version": "0.1.2",
"version": "0.1.3",
"description": "Simple wrapper for build scripts to stabilize API and to scaffold views and common patterns of cml-frontend boilerplate. Not for standalone usage.",

@@ -5,0 +5,0 @@ "bin": {

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