Skip to content

Nova

Nova 是一款专为 macOS 设计的快速、灵活且功能强大的原生文本编辑器。Protocol Launcher 允许你生成深度链接,用于在 Nova 中打开文件、文件夹、克隆仓库等。

使用

提供两种使用方式:

  • 按需加载(通过子路径导入),支持 Tree Shaking,体积更小。
  • 全量导入(从根包导入),使用简单,但会包含所有应用模块。

生产环境建议使用按需加载以减小体积;快速脚本或演示可选择全量导入。

选择安装方式

按需加载
推荐使用。生产环境优化。
全量导入
使用便捷。适合快速脚本。

打开编辑器

On-Demand
ts
import { open } from 'protocol-launcher/nova'

const url = open()

打开文件

On-Demand
ts
import { openFile } from 'protocol-launcher/nova'

const url = openFile({
  path: '/etc/hosts',
  line: 1,
  column: 2,
})

打开文件夹

On-Demand
ts
import { openFolder } from 'protocol-launcher/nova'

const url = openFolder({
  path: '/etc',
})

克隆项目

On-Demand
ts
import { cloneProject } from 'protocol-launcher/nova'

const url = cloneProject({
  url: 'https://github.com/zhensherlock/protocol-launcher.git',
})

打开扩展

On-Demand
ts
import { openExtension } from 'protocol-launcher/nova'

const url = openExtension({
  id: 'com.panic.Playdate',
})

注册 Nova

On-Demand
ts
import { register } from 'protocol-launcher/nova'

const url = register({
  serial: 'NOVA-XXXX-XXXX-XXXX-XXXX-XXXX-X',
})