Configure your desired indentation model and put spaces with fixed tabsizes in between strings
npm install indent-modelnpm i indent-model
javascript
const IndentModel = require("indent-model");
`
Class IndentModel
IndentModel.tabify(...data)
data <Primitive>
Typically <Primitive> types can be joined into a printable string. This method does not have features to join objects and arrays into strings like console.log does.
new IndentModel([options])
options <Object> optional
minDistance <integer> Default: 2
The minimal amount of spaces that separates two strings from each other.
Example
`javascript
const IndentModel = require("indent-model");
const itemsToLog = [
"2020-08-06T00:00:00.000+0200",
"GET",
"/v1/some/api/endpoint",
"monkey",
1273457,
true,
false
];
//
const tabs4 = new IndentModel();
console.log(tabs4.tabify(...itemsToLog));
"2020-08-06T00:00:00.000+0200 GET /v1/some/api/endpoint monkey 1273457 true false"
//--,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,---,
//
const tabs6 = new IndentModel({ tabSize: 6, minDistance: 4 });
console.log(tabs6.tabify(...itemsToLog));
"2020-08-06T00:00:00.000+0200 GET /v1/some/api/endpoint monkey 1273457 true false"
//----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,
``