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

cbml

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbml - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

29

cli.js
#!/usr/bin/env node
'use strict';
var cbml = require('./');
var optimist = require('optimist');
var mkdirp = require('mkdirp');
var fs = require('fs');

@@ -9,21 +11,9 @@ var path = require('path');

/*
* 保证目录存在
*
* @param{String} dir 目录
*/
function forceDirSync(dir) {
if (!fs.existsSync(dir)) {
forceDirSync(path.dirname(dir));
fs.mkdirSync(dir);
}
}
var argv = optimist
.usage('$0 input1.js [input2.js] -o output')
.alias("o", "output")
.alias('o', 'output')
.describe('o', 'output file.')
.string('o')
.alias("v", "version")
.describe("v", "Print version number and exit.")
.alias('v', 'version')
.describe('v', 'Print version number and exit.')
.wrap(80)

@@ -33,3 +23,3 @@ .argv;

if (argv.version) {
var json = require("../package.json");
var json = require('../package.json');
console.log(json.name + ' ' + json.version);

@@ -46,3 +36,3 @@ return;

var filenames = [];
argv._.forEach(function(filename) {
argv._.forEach(function (filename) {
filenames.push(filename);

@@ -53,7 +43,8 @@ contents.push(JSON.stringify(cbml.parse(fs.readFileSync(filename), argv), null, ' '));

if (argv.output) {
forceDirSync(path.dirname(argv.output));
mkdirp(path.dirname(argv.output));
fs.writeFileSync(argv.output, content);
console.log(util.format('%j cbml output complete.', filenames));
} else {
}
else {
console.log(content);
}
{
"name": "cbml",
"version": "0.0.4",
"version": "0.0.5",
"description": "CBML Parser",

@@ -21,4 +21,5 @@ "homepage": "https://github.com/cbml/cbmljs",

"dependencies": {
"colors": "1.0.3",
"optimist": "0.6.1"
"mkdirp": "^0.5.0",
"colors": "^1.0.3",
"optimist": "^0.6.1"
},

@@ -25,0 +26,0 @@ "devDependencies": {

@@ -351,2 +351,3 @@ (function (exportName) {

case 'commentRight':
case 'right':
if (token.type === 'right') {

@@ -353,0 +354,0 @@ items = lefts;

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