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

@spaceflow/shared

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spaceflow/shared

Spaceflow 公共工具库

Source
npmnpm
Version
0.7.0
Version published
Maintainers
1
Created
Source

@spaceflow/shared

License: MIT

轻量公共工具库,@spaceflow/cli@spaceflow/core 共同依赖。

定位

@spaceflow/shared 提供 CLI 壳子和 core 运行时都需要的基础工具函数,避免 CLI 直接依赖 core 的重量级模块。

模块

模块说明
config配置文件读写(readConfigSyncwriteConfigSyncdeepMerge
spaceflow-dir.spaceflow/ 工作目录管理
package-manager包管理器检测(pnpm / npm)
source-utils源类型判断(npm / git / local)
editor-config编辑器目录映射
verbose日志级别定义与解析

主要导出

// 配置
import {
  readConfigSync,
  writeConfigSync,
  deepMerge,
  getConfigPath,
  getDependencies,
  updateDependency,
  removeDependency,
  getSupportedEditors,
} from "@spaceflow/shared";

// .spaceflow/ 目录
import {
  ensureSpaceflowDir,
  ensureSpaceflowPackageJson,
  ensureDependencies,
  loadExtensionsFromDir,
  SPACEFLOW_DIR,
} from "@spaceflow/shared";

// 包管理器
import {
  getPackageManager,
  detectPackageManager,
  isPnpmWorkspace,
} from "@spaceflow/shared";

// 源类型
import {
  getSourceType,
  isGitUrl,
  isLocalPath,
  normalizeSource,
  extractNpmPackageName,
} from "@spaceflow/shared";

// 编辑器
import {
  EDITOR_DIR_MAPPING,
  DEFAULT_EDITOR,
  getEditorDirName,
} from "@spaceflow/shared";

// 日志级别
import { shouldLog, normalizeVerbose, parseVerbose } from "@spaceflow/shared";

依赖关系

@spaceflow/cli ──→ @spaceflow/shared
@spaceflow/core ─→ @spaceflow/shared(重导出部分模块)

许可证

MIT

FAQs

Package last updated on 03 Mar 2026

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