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 🙏

© 2024 – Pkg Stats / Ryan Hefner

lila-tasks

v1.0.3

Published

lila built-in tasks

Downloads

10

Readme

lila-tasks

中文文档

Lila built-in tasks.

install

npm install --save-dev lila-tasks

use

In lila.init.js:

import tasksPlugin from 'lila-tasks';

export default lila => {
  tasksPlugin(lila);

  ...
};

built-in tasks

@lila/make: create a file(relative to root)

['@lila/make', {file, content, force}]}]
  • file: type: string file to handle.
  • content: type: string file content.
  • force: type: bool default: false whether to override if file already existed.

@lila/replace: replace file content(relative to root)

['@lila/replace', {file, replace: [{target, replacement}]}]
  • file: type: string file to handle.
  • replace: type: [] options to replace.
    • target: type: string|RegExp target to be replaced.
    • replacement: type: string string to replace.

@lila/insert: insert file content(relative to root)

['@lila/insert', {file, start, end}]
  • file: type: string file to handle.
  • start: type: string content to prepend.
  • end: type: string content to append.

@lila/convert: convert file extension(relative to root)

['@lila/convert', {file, ext}]
  • file: type: string file to handle.
  • ext: type: string extension name, like php, jsp.

@lila/backup: backup file(relative to root)

Copy file to a suffixed name, index.html -> index.2000-01-02-03-04-05.html.

['@lila/backup', {file, suffix}]
  • file: type: string file to handle.
  • suffix: type: string default: (new Date()).getTime() index.html -> index.${suffix}.html.

@lila/move: move file or directory(relative to root)

['@lila/move', {source, target, force}]
  • source: type: string source file or directory
  • target: type: string target file or directory
  • force: type: bool default: false whether to override if target already existed.

@lila/copy: copy file or directory(relative to root)

['@lila/copy', {source, target, force}]
  • source: type: string source file or directory
  • target: type: string target file or directory
  • force: type: bool default: false whether to override if target already existed.

@lila/del: delete files or directories(relative to root)

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

@lila/del-dev: delete dev directory

'@lila/del-dev'

@lila/del-build: delete build directory

'@lila/del-build'

@lila/del-tmp: delete tmp directory

'@lila/del-tmp'

@lila/sync: sync files to remote server

['@lila/sync', {src, server, remotePath}]
  • src: globs/[globs, options] gulp.src
  • server: type: {} server config, see gulp-ssh.
  • remotePath: type: string remote server path to upload to.
  • cache: type: boolean default: false whether to cache files.
  • cacheFileName: type: string default: cache file name to record cache.

@lila/sync-save-cache: save files handling record after @lila/sync task

['@lila/sync-save-cache', {cacheFileName}]
  • cacheFileName: type: string default: cache file name to record cache.

@lila/sync-dir: sync directories to remote server(relative to root)

['@lila/sync-dir', {server, remotePath, dirs}]
  • server: type: {} server config, see gulp-ssh.
  • remotePath: type: string remote server path to upload to.
  • dirs: type: string/array directories to sync.

@lila/sync-build: sync build directory to remote server(relative to root)

['@lila/sync-build', {server, remotePath, sourceMap}]
  • server: type: {} server config, see gulp-ssh.
  • remotePath: type: string remote server path to upload to.
  • sourceMap: type: bool default: true whether to upload source-map files.

@lila/sync-html: sync html files to remote server(relative to build)

['@lila/sync-html', {server, remotePath, ext}]
  • server: type: {} server config, see gulp-ssh.
  • remotePath: type: string remote server path to upload to.
  • ext: type: string default: html html file extension.

@lila/sync-source-map: sync source-map files to remote server(relative to build)

['@lila/sync-source-map', {server, remotePath}]
  • server: type: {} server config, see gulp-ssh.
  • remotePath: type: string remote server path to upload to.

@lila/clean-cache: remove handled files by last handling, and remain new files, mainly for build directory

'@lila/clean-cache'
// or
['@lila/clean-cache', {dir, cacheFileName}]
  • dir: type: string directory to handle(relative to root)
  • cacheFileName: type: string default: cache file name to record cache.

@lila/save-cache: save files handling record, mainly for build directory

'@lila/save-cache'
// or
['@lila/save-cache', {dir, cacheFileName}]
  • dir: type: string directory to handle(relative to root)
  • cacheFileName: type: string default: cache file name to record cache.

@lila/shell: execute shell scripts

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

@lila/ssh-exec: execute commands on remote server

Available version >= v1.0.1

['@lila/ssh-exec', {server, script}]
  • server: type: {} server config, see ssh2 connect.
  • script: type: string commands to execute on remote server. Use && to concat multiple commands.

@lila/remote-exec: execute commands on remote server

Available version >= v1.0.1

['@lila/remote-exec', {server, scripts, log}]
  • server: type: {} server config, see gulp-ssh exec.
  • scripts: type: string/array commands to execute on remote server.
  • log: type: string default: remote-exec.log log file.

@lila/remote-shell: execute shell scripts on remote server

!!!Some commands will hang the connection, causing the connection not to finish. Please use @lila/ssh-exec or @lila/remote-exec instead.

['@lila/remote-shell', {server, scripts, log}]
  • server: type: {} server config, see gulp-ssh shell.
  • scripts: type: string/array shell scripts to execute on remote server.
  • log: type: string default: remote-shell.log log file.