Installation
How to install and configure sc-fns in your JavaScript or TypeScript projects.
Package Manager Installation
Install sc-fns using your package manager of choice:
pnpm (Recommended)
bash
npm
bash
yarn
bash
bun
bash
TypeScript Setup
sc-fns ships with declaration files (.d.ts) and declaration maps generated directly from TypeScript source code. No additional @types/sc-fns package is needed.
For optimal subpath import resolution, verify that your tsconfig.json has moduleResolution set to either Bundler or NodeNext:
tsconfig.json
Framework Integration
Next.js (App Router / Pages Router)
sc-fns works out of the box with Next.js 13, 14, 15, and 16. Both Server Components and Client Components can import utilities directly:
app/page.tsx
If you are using sc-fns inside a Turborepo monorepo workspace, specify transpilePackages in next.config.ts:
next.config.ts
Vite & React / Vue / Svelte
No special configuration required. Simply import functions into your components:
ts
Node.js (CommonJS & ESM)
sc-fns provides dual builds (dist/index.js for ESM and dist/index.cjs for CommonJS):
Modern ESM ("type": "module")
ts
Legacy CommonJS
js
How is this guide?
Last updated on October 25, 2026