npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lila-tasks

v2.0.2

Published

lila built-in tasks

Readme

lila-tasks

English Documentation

lila 内置的 tasks

安装

npm install --save-dev lila-tasks

使用

lila.init.js 中:

import tasksPlugin from 'lila-tasks';

export default lila => {
  tasksPlugin(lila);

  ...
};

内置任务

@lila/make: 创建文件(相对于 root)

['@lila/make', {file, content, force}]}]
  • file: type: string 要操作的文件.
  • content: type: string 文件内容.
  • force: type: bool default: false 如果文件已存在,是否覆盖.

@lila/replace: 替换文件内容(相对于 root)

['@lila/replace', {file, replace: [{target, replacement}]}]
  • file: type: string 要操作的文件.
  • replace: type: [] 替换选项.
    • target: type: string|RegExp 需要被替换的文本.
    • replacement: type: string 替换的文本.

@lila/insert: 插入文件内容(相对于 root)

['@lila/insert', {file, start, end}]
  • file: type: string 要操作的文件.
  • start: type: string 插入在文件最前面的内容.
  • end: type: string 插入在文件最后面的内容.

@lila/convert: 更改文件的扩展名(相对于 root)

['@lila/convert', {file, ext}]
  • file: type: string 要操作的文件.
  • ext: type: string 扩展名, 如 php, jsp.

@lila/backup: 备份文件(相对于 root)

复制文件并添加后缀, index.html -> index.2000-01-02-03-04-05.html.

['@lila/backup', {file, suffix}]
  • file: type: string 要操作的文件.
  • suffix: type: string default: (new Date()).getTime() index.html -> index.${suffix}.html.

@lila/move: 移动文件或目录(相对于 root)

['@lila/move', {source, target, force}]
  • source: type: string 源文件或目录
  • target: type: string 目标文件或目录
  • force: type: bool default: false 如果目录已存在,是否覆盖

@lila/copy: 复制文件或目录(相对于 root)

['@lila/copy', {source, target, force}]
  • source: type: string 源文件或目录
  • target: type: string 目标文件或目录
  • force: type: bool default: false 如果目录已存在,是否覆盖

@lila/del: 删除文件或目录(相对于 root)

['@lila/del', file]
['@lila/del', dir]
['@lila/del', [file1, dir2, dir3, ...]]

@lila/del-dev: 删除 dev 目录

'@lila/del-dev'

@lila/del-build: 删除 build 目录

'@lila/del-build'

@lila/del-tmp: 删除 tmp 目录

'@lila/del-tmp'

@lila/sync: 同步文件到远程服务器

['@lila/sync', {src, server, remotePath}]
  • src: globs/[globs, options] gulp.src
  • server: type: {} 服务器配置, 查看 gulp-ssh.
  • remotePath: type: string 要上传的远程服务器路径.
  • cache: type: boolean default: false 是否缓存已上传的文件.
  • cacheFileName: type: string default: cache 缓存记录生成的文件名.

@lila/sync-save-cache: 运行 @lila/sync 任务后保存操作文件的记录

['@lila/sync-save-cache', {cacheFileName}]
  • cacheFileName: type: string default: cache 缓存记录生成的文件名.

@lila/sync-dir: 同步目录到远程服务器(相对于 root)

['@lila/sync-dir', {server, remotePath, dirs}]
  • server: type: {} 服务器配置, 查看 gulp-ssh.
  • remotePath: type: string 要上传的远程服务器路径.
  • dirs: type: string/array 要上传的目录.

@lila/sync-build: 同步 build 目录到远程服务器(相对于 root)

['@lila/sync-build', {server, remotePath, sourceMap}]
  • server: type: {} 服务器配置, 查看 gulp-ssh.
  • remotePath: type: string 要上传的远程服务器路径.
  • sourceMap: type: bool default: true 是否上传 source-map 文件.

@lila/sync-html: 同步 html 文件到远程服务器(相对于 build)

['@lila/sync-html', {server, remotePath, ext}]
  • server: type: {} 服务器配置, 查看 gulp-ssh.
  • remotePath: type: string 要上传的远程服务器路径.
  • ext: type: string default: html html 文件扩展名.

@lila/sync-source-map: 同步 source-map 文件到远程服务器(相对于 build)

['@lila/sync-source-map', {server, remotePath}]
  • server: type: {} 服务器配置, 查看 gulp-ssh.
  • remotePath: type: string 要上传的远程服务器路径.

@lila/clean-cache: 移除上次操作过的文件,保留未操作过的文件,主要用于记录 build 目录

'@lila/clean-cache'
// or
['@lila/clean-cache', {dir, cacheFileName}]
  • dir: type: string 待操作的目录(相对于 root)
  • cacheFileName: type: string default: cache 缓存记录生成的文件名.

@lila/save-cache: 保存文件到操作记录中, 主要用于记录 build 目录

'@lila/save-cache'
// or
['@lila/save-cache', {dir, cacheFileName}]
  • dir: type: string 待操作的目录(相对于 root)
  • cacheFileName: type: string default: cache 缓存记录生成的文件名.

@lila/shell: 执行 shell 脚本

['@lila/shell', {command, args, options}]

@lila/ssh-exec: 在远程服务器执行命令

可用版本 >= v1.0.1

['@lila/ssh-exec', {server, script}]
  • server: type: {} 服务器配置, 查看 ssh2 connect.
  • script: type: string 需要在远程服务器执行的命令,多个命令可使用 && 连接.

@lila/remote-exec: 在远程服务器执行命令

可用版本 >= v1.0.1

['@lila/remote-exec', {server, scripts, log}]
  • server: type: {} 服务器配置, 查看 gulp-ssh exec.
  • scripts: type: string/array 需要在远程服务器执行的命令.
  • log: type: string default: remote-exec.log 日志文件.

@lila/remote-shell: 在远程服务器执行 shell 脚本

!!!某些命令可能会导致连接挂起不结束,请使用@lila/ssh-exec@lila/remote-exec代替

['@lila/remote-shell', {server, scripts, log}]
  • server: type: {} 服务器配置, 查看 gulp-ssh shell.
  • scripts: type: string/array 需要在远程服务器执行的 shell 脚本.
  • log: type: string default: remote-shell.log 日志文件.