New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

indent-model

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indent-model

Configure your desired indentation model and put spaces with fixed tabsizes in between strings

latest
Source
npmnpm
Version
3.0.0
Version published
Maintainers
1
Created
Source

IndentModel

Configure an indentation model and put spaces with fixed tabsizes in between strings

npm i indent-model
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.
    Returns <string> A tabified string. Examples are shown below.

new IndentModel([options])

    options <Object> optional
      tabSize <integer> Default: 4 The amount of spaces one tab is made up of.
      minDistance <integer> Default: 2 The minimal amount of spaces that separates two strings from each other.

Example

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"
//----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,-----,

FAQs

Package last updated on 30 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts