How to use nomnom - 10 common examples

To help you get started, we’ve selected a few nomnom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CommerceRack / anycommerce / utilities / nodesitemap / sitemap.js View on Github external
//
// SITEMAP GENERATOR
//


var fs = require('fs');
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest;
var dateFormat = require('dateformat');
var now = new Date();

var opts = require('nomnom')
        .option('domain', {
                abbr: 'd',
                required : true,
                help : 'domain to generate a sitemap for'
                })
        .option('path', {
                abbr: 'p',
                default : './',
                help : 'path to write the file'
                })
		.option('customurls',{
				abbr:'c',
				default : false,
				help : 'path to json file containing an array of custom urls to be added to the sitemap'
				}).parse();
github DmitrySoshnikov / syntax / src / bin / syntax.js View on Github external
* The MIT License (MIT)
 * Copyright (c) 2015-present Dmitry Soshnikov 
 */

'use strict';

/*global ROOT:true*/

// To require local modules from root.
global.ROOT = __dirname + '/../';

const colors = require('colors');
const fs = require('fs');
const path = require('path');

const options = require('nomnom')
  .script('syntax')
  .options({
    version: {
      abbr: 'v',
      help: 'Print current version',
      flag: true,
    },
    mode: {
      abbr: 'm',
      transform: normalizeMode,
    },
    grammar: {
      abbr: 'g',
      help: 'File containing LL or LR grammar',
      metavar: 'FILE',
    },
github harthur / kittydar / training / neuralnet / test-network.js View on Github external
var fs = require("fs"),
    path = require("path"),
    brain = require("brain"),
    nomnom = require("nomnom"),
    params = require("./params"),
    utils = require("../../utils"),
    collect = require("../collect");

var opts = nomnom.options({
  pos: {
    abbr: 'p',
    list: true,
    required: true,
    help: "Directory of test positive images"
  },
  neg: {
    abbr: 'n',
    list: true,
    required: true,
    help: "Directory of test negative images"
  },
  json: {
    default: __dirname + "/network.json",
    help: "Neural network JSON file"
  },
github harthur / kittydar / training / svm / test-svm.js View on Github external
var fs = require("fs"),
    path = require("path"),
    nomnom = require("nomnom"),
    svm = require("svm"),
    params = require("./params"),
    utils = require("../../utils"),
    collect = require("../collect");

var opts = nomnom.options({
  pos: {
    abbr: 'p',
    list: true,
    required: true,
    help: "Directory of positive test images"
  },
  neg: {
    abbr: 'n',
    list: true,
    required: true,
    help: "Directory of negative test images"
  },
  jsonFile: {
    default: __dirname + "/svm.json",
    help: "SVM JSON file"
  },
github mozilla / node-firefox-find-ports / bin / fx-ports.js View on Github external
var fs = require('fs');
var path = require('path');
var Table = require('cli-table');
var discoverPorts = require('../index');

var table = new Table({
  chars: { 'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': ''
         , 'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': ''
         , 'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': ''
         , 'right': '' , 'right-mid': '' , 'middle': ' ' },
  style: { 'padding-left': 0, 'padding-right': 4 }
});

var types = {b2g: "Firefox OS", firefox:"Firefox Desktop"};

var opts = require("nomnom")
  .option('version', {
    flag: true,
    help: 'Print version and exit',
    callback: function() {
      fs.readFile(path.resolve(__dirname, '../package.json'), 'utf-8', function(err, file) {
        console.log(JSON.parse(file).version);
      });
    }
  })
  .option('b2g', {
    flag: true,
    help: 'Show Boot2Gecko (FirefoxOS) listening ports only'
  })
  .option('release', {
    list: true,
    help: 'Release of FirefoxOS to filter',
github raphamorim / node-replace / bin / search.js View on Github external
#!/usr/bin/env node

var nomnom = require("nomnom"),
  replace = require("../replace"),
  sharedOptions = require("./shared-options");

var options = nomnom.options(sharedOptions)
  .script("search")
  .parse();

replace(options);
github trailbehind / tile-squirrel / bin / add-tile-list.js View on Github external
#!/usr/bin/env node

"use strict";
var debug = require("debug")("tile-squirrel-add-tile-list"),
  QueueWriter = require("../lib/queueWriter");

var nomnom = require("nomnom")
  .options({
    sources: {
      position: 0,
      help: "source names to queue",
      list: true
    },
    file: {
      abbr: "f",
      metavar: "FILE",
      help: "Read list from file. By default list is read from STDIN"
    },
    version: {
      abbr: "v",
      flag: true,
      help: "Show version info",
      callback: function() {
github trailbehind / tile-squirrel / bin / add-tile.js View on Github external
#!/usr/bin/env node

"use strict";

var debug =  require("debug")("tile-squirrel-add-tile"),
  QueueWriter =  require("../lib/queueWriter"),
  path = require("path");


var nomnom = require("nomnom")
  .options({
    source: {
      position: 0,
      help: "Source to queue",
    },
    tile: {
      position: 1,
      help: "Tile to queue",
    },
    config: {
      abbr: "c",
      metavar: "CONFIG",
      help: "Provide a configuration file. Configuration file is not needed," + 
      " but if it is provided sources will be verified to exist in config."
    },
    version: {
github trailbehind / tile-squirrel / bin / copy-info.js View on Github external
#!/usr/bin/env node

"use strict";
var debug = (debug = require("debug")("tile-squirrel-add-bbox")),
  path = require("path"),
  Q = require("q");

var nomnom = require("nomnom")
  .options({
    sources: {
      position: 0,
      help: "source names to queue",
      list: true
    },
    config: {
      abbr: "c",
      metavar: "CONFIG",
      help: "Configuration file."
    },
    version: {
      abbr: "v",
      flag: true,
      help: "Show version info",
      callback: function() {
github trailbehind / tile-squirrel / bin / squirrel.js View on Github external
#!/usr/bin/env node

"use strict";

process.env.UV_THREADPOOL_SIZE = process.env.UV_THREADPOOL_SIZE || 4;

var nomnom = require("nomnom")
  .options({
    config: {
      abbr: "c",
      metavar: "CONFIG",
      required: true,
      help: "Provide a configuration file"
    },
    require: {
      abbr: "r",
      metavar: "MODULE",
      help: "Require a specific tilelive module",
      list: true
    },
    defer: {
      abbr: "d",
      flag: true,

nomnom

Option parser with generated usage and commands

MIT
Latest version published 10 years ago

Package Health Score

50 / 100
Full package analysis