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

@hutsoninc/utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hutsoninc/utils

Hutson marketing team utility belt

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

utils

Build Status Current npm package version

Hutson marketing team utility belt. Used for prototyping and creating one-off tools and scripts.

Usage

npm install @hutsoninc/utils

const {
    csvToJson,
} = require('@hutsoninc/utils')

const csv = 'id\n1\n2'

await csvToJson(csv)
// => [{id: 1}, {id: 2}]

API

csvToJson

Converts a CSV string to a JavaScript object.

const csv = 'id\n1\n2'

await csvToJson(csv)
// => [{id: 1}, {id: 2}]

delay

Asynchronous function to wait for a specified amount of time in ms.

await delay(3000)
// Resolves after 3000ms (3 seconds)

jsonToCsv

Converts a JavaScript object to a CSV string.

const obj = [{ id: 1 }, { id: 2 }]

jsonToCsv(obj, ['id'])
// => 'id\n1\n2'

xmlToJson

Converts a XML string to a JavaScript object.

const xml = '<root>Hello World</root>'

await xmlToJson(xml)
// => { root: 'Hello World' }

License

MIT © Hutson Inc

FAQs

Package last updated on 01 Jul 2019

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