🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@toss/ky

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toss/ky

latest
Source
npmnpm
Version
1.2.1
Version published
Weekly downloads
1.5K
-18.01%
Maintainers
5
Weekly downloads
 
Created
Source

@toss/ky

A library which wraps ky to be compliant to both CommonJS and ECMAScript Modules.

Check out the ky docs for usage.

$ node
> require("@toss/ky")
# -> Available

> await import("@toss/ky")
# -> Available

Motivation

ky has the following problems.

  • Since it is ESM-only, require() calls fail.
  • For server-side rendering, we should use the separate ky-universal library.

@toss/ky improves ky to be used easily.

  • It is compiled beforehand with ESBuild, enabling it to be used both in CommonJS and ESM.
  • Even in server-side rendered services, you could only use @toss/ky, not having to think about what to use between ky-universal and ky.

Why are the build results version controlled?

  • When the built code is not version controlled, we cannot run tests in the workspace, since require('ky') is run and ERR_REQUIRE_ESM errors are thrown.
  • To update the built code, run yarn build in the package, and commit the diffs.

FAQs

Package last updated on 24 Oct 2024

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