@apideck/wayfinder

中文文档
0.2.6发布于 2026/06/02MITTypeScriptESM + CJS近 30 天下载 1.5万

WayFinder is a TypeScript-based application that helps you navigate through your JSON data. It provides a user-friendly interface for navigating / querying your JSON data and building JSONPath expressions.

原始使用文档
文档目录6 节
  1. Using WayFinder
  2. Getting started
  3. Running Locally
  4. Storybook
  5. Building the Project
  6. Linting

WayFinder

WayFinder is a TypeScript-based application that helps you navigate through your JSON data. It provides a user-friendly interface for navigating / querying your JSON data and building JSONPath expressions.

Using WayFinder

  1. Place your desired JSON in the left pane.
  2. To build a JSONPath, simply click on any key within the JSON data. This will automatically add it to the JSONPath.
  3. If you aim to target an item within an array, select a value one of the item's properties to insert a filter expression.
  4. To verify the correctness of your JSONPath, press the 'Test' button. Valid JSONPaths will have their results showcased in the right pane.

You can also manually adjust or add a filter expression directly in the JSONPath.

WayFinder Application

Getting started

  1. Install the package:
yarn add @apideck/wayfinder
  1. Update your tailwind.config.js file and add the following path to your content array:
// tailwind.config.js

module.exports = {
  content: [
    // ...
    './node_modules/@apideck/wayfinder/**/*.js'
  ]
  // ...
}
  1. Import the WayFinder component and use it in your application:
import { Button, useModal } from '@apideck/components'
import { WayFinder } from '@apideck/wayfinder'

const exampleResponse = JSON.stringify(
  {
    id: 'file',
    value: 'File',
    popup: {
      menuitem: [
        { id: 1, name: 'New' },
        { id: 2, name: 'Open' },
        { id: 3, name: 'Close' }
      ]
    }
  },
  null,
  2
)

const modalOptions = {
  className: '!max-w-5xl !p-0',
  onClose: () => console.log('Closing modal..')
}

const MyComponent = () => {
  const { addModal, removeModal } = useModal()

  return (
    <Button
      text="Open WayFinder"
      onClick={() => {
        addModal(
          <WayFinder
            onSelect={(jsonPath) => {
              console.log(jsonPath)
              removeModal()
            }}
            onClose={removeModal}
            defaultInput={exampleResponse}
          />,
          modalOptions
        )
      }}
    />
  )
}

export default MyComponent

Running Locally

To run the WayFinder application locally, you need to have Node.js and Yarn installed on your machine. Once you have these prerequisites, follow the steps below:

  1. Clone the repository to your local machine.

  2. Navigate to the project directory and install the dependencies by running:

yarn install

Storybook

This project includes Storybook for developing and testing UI components in isolation. To run Storybook, use the following command:

yarn storybook

This will start Storybook on a local server, typically http://localhost:6006 and open a browser window with the Storybook UI. You can then navigate to the component you want to test and interact with it in isolation.

Building the Project

To build the project for production, use the following command:

yarn build

This will create a dist folder in the project root directory with the compiled assets ready for deployment.

Linting

The project uses ESLint for linting. To run the linter, use the following command:

yarn lint

This will run ESLint on the project and report any linting errors.

Remember to always follow the best practices and guidelines provided in the codebase when contributing to the project.

版本与发布记录

@apideck/wayfinder 共发布 19 个版本,首次发布于 2023/10/24;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.2.6latest2026/06/025 个月前
0.2.52023/11/072 年前
0.2.42023/11/033 年前
0.2.32023/11/023 年前
0.2.22023/11/023 年前
0.2.12023/11/023 年前

关于 @apideck/wayfinder 的常见问题

@apideck/wayfinder 是什么?

WayFinder is a TypeScript-based application that helps you navigate through your JSON data. It provides a user-friendly interface for navigating / querying your JSON data and building JSONPath expressions.

如何安装 @apideck/wayfinder?

在项目目录运行 npm install @apideck/wayfinder,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^16.8.0 || ^17.0.0 || ^18.0.0)、react-dom(^16.8.0 || ^17.0.0 || ^18.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@apideck/wayfinder 支持 TypeScript 吗?

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

@apideck/wayfinder 支持 ESM 还是 CommonJS?

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

@apideck/wayfinder 可以商用吗?

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

@apideck/wayfinder 的下载量有多少?

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

@apideck/wayfinder 还在维护吗?

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