Skip to content

A collection of functions I often use in my projects, mostly for developing

License

Notifications You must be signed in to change notification settings

jeroentvb/jeroentvb-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

helper

A collection of functions I often use in my projects

Installation

npm install jeroentvb/helper

Usage

const helper = require('jeroentvb-helper')

Functions

helper.export.json(name, item, verbose)
helper.export.text(name, item, verbose)

Exports an object or array to a .json file in the root of a project.

name
A string. The name the exported file will have.

item
Object or array. This will be exported to the contents of the file.

verbose
Optional
If set to false, nothing will be logged to the console. Default is true

helper.export.custom(filename, item, verbose)

Exports the passed item in a specified format

filename
A string. The name the exported file will have, this must include the file extension.

item
Object or array or string. This will be exported to the contents of the file.

verbose
Optional
If set to false, nothing will be logged to the console. Default is true

helper.stringify(item)

Returns an object, array or anything in form of a nicely formatted, readable string (instead of a single line string). Useful for logging to the console.

item
The object, array or something else you want to transform into a string.

helper.log(item)

Logs an item to the console. If it's an object it will be made a little more readable, instead of collapsed.

item
Object that you want to log to the console.

About

A collection of functions I often use in my projects, mostly for developing

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published