npm.io
0.1.2 • Published 9 years ago

@fendy3002/string-tools

Licence
MIT
Version
0.1.2
Deps
37
Vulns
1
Weekly
0
Stars
7

QzStringTools

A simple application to help converting some text with specific format to desired format using configurable commands.

Running app

This repo comes with app server, run in http://localhost:3000.

git clone https://github.com/fendy3002/QzStringTools.git;

cd QzStringTools;

npm install;

npm start;

Installing

When you want to use this library in your own node project, you can install it via npm install.

npm install --save @fendy3002/string-tools

Basic usage

var StringTools = require('@fendy3002/string-tools');
var Config = StringTools.defaultConfig;

var input = 'Hello, world \n' +
        'how, are, you?';

var selectedCommand = null;
for(var i = 0; i < Config.command.length; i++){
    selectedCommand = Config.command[i];
    if(selectedCommand.code == 'sql-single-quote'){ break; }
}

var result = StringTools.convert(input, selectedCommand, Config);
console.log('result', result);

Use cases

From excel spreadsheet to sql select

From excel spreadsheet (tab delimited) to mysql select union all

From newline delimited to be part of select in

From newline delimited to be part of select in

From PHP Array to Object syntax

From php array syntax to object syntax

Keywords