概述
命令行接口 (CLI) sv
是用于创建和维护 Svelte 应用的工具包。
¥The command line interface (CLI), sv
, is a toolkit for creating and maintaining Svelte applications.
用法(Usage)
¥Usage
运行 sv
的最简单方法是使用 npx
(或者如果你使用的是其他包管理器,则使用等效命令 - 例如,如果你使用的是 pnpm,则使用 pnpx
):
¥The easiest way to run sv
is with npx
(or the equivalent command if you’re using a different package manager — for example, pnpx
if you’re using pnpm):
npx sv <command> <args>
如果你在已经安装 sv
的项目中,这将使用本地安装,否则它将下载最新版本并运行它而不安装它,这对 sv create
特别有用。
¥If you’re inside a project where sv
is already installed, this will use the local installation, otherwise it will download the latest version and run it without installing it, which is particularly useful for sv create
.
致谢(Acknowledgements)
¥Acknowledgements
感谢 npm 上最初拥有 sv
名称的 Christopher Brown 慷慨地允许它用于 Svelte CLI。你可以在 @chbrown/sv
找到原始 sv
包。
¥Thank you to Christopher Brown who originally owned the sv
name on npm for graciously allowing it to be used for the Svelte CLI. You can find the original sv
package at @chbrown/sv
.