
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@goatlab/js-utils
Advanced tools
A comprehensive collection of TypeScript utilities for both Node.js and browser environments. This package provides essential helpers for working with arrays, objects, strings, promises, HTTP requests, and more.
npm install @goatlab/js-utils
# or
yarn add @goatlab/js-utils
# or
pnpm add @goatlab/js-utils
import { Arrays, Objects, Strings, Promises, Http } from '@goatlab/js-utils'
// Array utilities
const numbers = [1, 2, 3, 4, 5, 6]
const chunks = Arrays.chunk(numbers, 2) // [[1, 2], [3, 4], [5, 6]]
const first = Arrays.first(numbers) // 1
const last = Arrays.last(numbers) // 6
// Object utilities
const obj = { a: 1, b: 2, c: 3 }
const picked = Objects.pick(obj, ['a', 'c']) // { a: 1, c: 3 }
const omitted = Objects.omit(obj, ['b']) // { a: 1, c: 3 }
const isEmpty = Objects.isEmpty({}) // true
// String utilities
const camelCase = Strings.camelCase('hello-world') // 'helloWorld'
const snakeCase = Strings.snakeCase('helloWorld') // 'hello_world'
const truncated = Strings.truncate('long text here', 8) // 'long tex...'
// Promise utilities
const [err, result] = await Promises.try(fetchData())
const results = await Promises.map(items, async (item) => process(item), { concurrency: 3 })
// HTTP client (based on ky)
const client = Http.getClient({
prefixUrl: 'https://api.example.com',
timeout: 30000
})
const data = await client.get('users').json()
chunk
, first
, last
, flatten
, uniq
, sortBy
, groupBy
pick
, omit
, merge
, isEmpty
, deepEquals
, mapValues
, filterValues
camelCase
, snakeCase
, kebabCase
, truncate
, before
, after
, template
round
, random
, inRange
, clamp
debounce
, throttle
, once
, memoize
try
, map
, props
, retry
, hang
ms
, since
)FAQs
Readable query Interface & API generator for TS and Node
The npm package @goatlab/js-utils receives a total of 43 weekly downloads. As such, @goatlab/js-utils popularity was classified as not popular.
We found that @goatlab/js-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.