Skip to content

Generate commands from a single one using csquare syntax.

License

Notifications You must be signed in to change notification settings

SquareFactory/crossp

Repository files navigation

@csquare/crossp

licence version coverage

Generate a batch of commands based on single one.

Maintained by:

Installation

Install with npm:

npm install --save @csquare/crossp

Install with Yarn:

yarn add @csquare/crossp

Usage

Basic usage

Using CommonJS syntax:

const { crossp } = require('@csquare/crossp');

const output = crossp();

Using ESM syntax (default import):

import crossp from '@csquare/crossp';

const output = crossp();

or

import { crossp } from '@csquare/crossp';

const output = crossp();

Examples

import crossp from '@csquare/crossp';

console.log(crossp('python train.py -e %[1,2]% -lr %[0.1,0.2]% -o %[in,out]%.txt'));

// console output:
[
  'python train.py -e 1 -lr 0.1 -o in.txt',
  'python train.py -e 1 -lr 0.1 -o out.txt',
  'python train.py -e 1 -lr 0.2 -o in.txt',
  'python train.py -e 1 -lr 0.2 -o out.txt',
  'python train.py -e 2 -lr 0.1 -o in.txt',
  'python train.py -e 2 -lr 0.1 -o out.txt',
  'python train.py -e 2 -lr 0.2 -o in.txt',
  'python train.py -e 2 -lr 0.2 -o out.txt',
];