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

artisan

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

artisan - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

69

lib/artisan.js
"use strict";
/*!
* Artisan
* Author: Kevin Coughlin @kevintcoughlin , <kevintcoughlin@gmail.com>
* MIT Licensed
*/
/**
* Module Dependencies
*/
var program = require('commander')

@@ -19,16 +28,47 @@ , fs = require('fs')

// If no app name was passed prompt user for one
/**
* If no app name was passed prompt user for one
*/
if(!program.args[0]) {
program.prompt('Please name your node module: ', function (name) {
process.stdin.destroy();
bootstrap(name);
// Prompt user for top-level dir name
program.prompt('Please name your node module: ', function ( name ) {
canCreate( name, bootstrap );
});
} else {
bootstrap(appName);
canCreate( appName, bootstrap );
}
/**
* Check if directory exists, if so then prompt to create or exit
*/
function canCreate( name, callback ) {
// Check if dir exists
if(fs.existsSync('./' + name)) {
// Confirm replacement of dir
program.confirm('Directory already exists. Replace? ', function( result ){
// Replace
if(result) {
process.stdin.destroy();
callback( name );
}
// Exit
else {
process.stdin.destroy();
console.log('You chose not to replace the directory.\nExiting Artisan now.');
return;
}
});
}
// Create dir
else {
process.stdin.destroy();
callback( name );
}
}
/**
* Bootstrap app files.
*/
function bootstrap( name ) {
console.log('Bootstrapping your new node module - ' + name);
//if (program.peppers) console.log(' - peppers');
//console.log(' - %s cheese', program.cheese);

@@ -96,15 +136,2 @@ mkdirp('./' + name, function (err) {

cursor.reset();
}
/*
function Artisan( ) {
if (!(this instanceof Artisan))
return new Artisan();
this.defaults = {
};
};
module.exports = Artisan;
*/
}

@@ -10,3 +10,3 @@ {

],
"version": "0.1.0",
"version": "0.1.1",
"author": "Kevin Coughlin <kevintcoughlin@gmail.com>",

@@ -13,0 +13,0 @@ "license": "MIT",

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