@better-pages-create/shared
v0.1.5
Published
Utility functions for better-pages-create
Downloads
7
Readme
@better-pages-create/shared
Better Pages Create 的共享工具包,提供核心包和集成包共用的工具函数。
安装
# npm
npm install @better-pages-create/shard
# yarn
yarn add @better-pages-create/shard
# pnpm
pnpm add @better-pages-create/shard使用
这个包主要供内部使用,通常不需要直接导入。如果您正在开发自己的集成,可以使用此包中的工具:
import { countSlash, debug, extsToGlob } from '@better-pages-create/shared'
// 使用调试工具
debug.pages('Processing pages...')
// 将扩展名数组转换为glob模式
const glob = extsToGlob(['tsx', 'jsx']) // 返回 "{tsx,jsx}"
// 计算路径中的斜杠数量
const depth = countSlash('/users/profile') // 返回 2文档
请参阅 主项目文档 获取更多信息。
许可证
MIT