@fjst/core

中文文档
0.4.0发布于 2026/08/06MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2275

fjst's core

原始使用文档
文档目录5 节
  1. Install
  2. API
  3. jsObf(src: string): string
  4. jsMinify(src: string, filepath: string): string
  5. jsTranspile(target: string | string[]): (src: string, filep…

@fjst/core

fjst's core. A small collection of source transforms for JavaScript output.

Install

npm install @fjst/core
bun add @fjst/core

API

jsObf(src: string): string

Obfuscates JavaScript source code. A thin wrapper around javascript-obfuscator.

import { jsObf } from "@fjst/core";

const obfuscated = jsObf("const answer = 42;");

jsMinify(src: string, filepath: string): string

Minifies JavaScript source code. A thin wrapper around oxc-minify. filepath is passed through to oxc-minify and is used to determine how the source should be parsed.

import { jsMinify } from "@fjst/core";

const minified = jsMinify("const answer = 42;", "answer.js");

jsTranspile(target: string | string[]): (src: string, filepath: string) => string

Downlevels JavaScript to a given ECMAScript target. A thin wrapper around oxc-transform. Unlike jsObf and jsMinify, this is a factory: call it with a target to get back a transpiler.

import { jsTranspile } from "@fjst/core";

const transpiler = jsTranspile("es2015");
const transpiled = transpiler("const add = (a, b) => a + b;", "add.js");

Targeting older environments may emit require("@oxc-project/runtime/...") helper calls (e.g. for private class fields); install @oxc-project/runtime if you use those features.

All three functions match the Transpiler shape expected by @fjst/sveltekit and can be passed directly into it (jsTranspile once called with a target).

版本与发布记录

@fjst/core 共发布 4 个版本,首次发布于 2026/07/31;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.0latest2026/08/063 个月前
0.3.02026/08/053 个月前
0.2.02026/07/313 个月前
0.1.02026/07/313 个月前

关于 @fjst/core 的常见问题

@fjst/core 是什么?

fjst's core

如何安装 @fjst/core?

在项目目录运行 npm install @fjst/core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:typescript(^6.0.2)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@fjst/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fjst/core 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@fjst/core 可以商用吗?

@fjst/core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fjst/core 的下载量有多少?

根据 npm 官方下载统计,@fjst/core 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,275 次,日均约 76 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fjst/core 还在维护吗?

最新版本 0.4.0 发布于 2026/08/06(3 个月前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/07/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。