Skip to content

srj-github/utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zrg's Utils

A collection of my utility functions written in Typescript.

Installation

Use the npm package manager.

npm install @zrgjs/utils

Usage

Import each function as needed.

import {function1, function2} from '@zrgjs/utils/lib'
// or 
const {function1, function2} = require('@zrgjs/utils/lib')

Functions

generateCsv

import {generateCsv} from '@zrgjs/utils/lib'

Generate a csv string from an Object with arrays of strings, where the key is the column title and all the strings from it's value array are the values from the same column.

Example:

{
  "title 1": ['value.t1.1', 'value.t1.2'],
  "title 2": ['value.t2.1', 'value.t2.2', 'value.t2.3']
}

Expected result:

title1,title2
value.t1.1,value.t2.1
value.t1.2,value.t2.2
,value.t2.3

All values can contain commas, it won't break the order.

generateGuid

import {generateGuid} from '@zrgjs/utils/lib/

Generate a 128-bit globally unique identifier.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published