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

lurkle

v0.7.1

Published

Lurkle is a CLI for managing the development environment of micro-services. It coordinates running scripts and starting services across multiple directories.

Downloads

32

Readme

Lurkle

Lurkle is a CLI for managing the development environment of micro-services. It coordinates running scripts and starting services across multiple directories.

Install

npm install -g lurkle
yarn global add lurkle

Tasks

The lurkle CLI can be used to coordinate the running of tasks in multiple directories. Lurkles are groups of tasks that lurk in sub-folders. You can configure them either directly in a lurkle-config.yml file from your project root or you can create lurkle.yml files that are imported into your config.

Configuring Tasks

Create a lurkle-config.yml a root folder above your services. This contains a list of the locations to where your lurkles reside as well as a list of possible tasks that each can run. This doubles as both configuration and documentation.

lurkles:
  - ./app-a
  - ./app-b
  
  - name: app-c
    cwd: './app-c'
    tasks:
      test: echo "running test from $(pwd)"

  - name: app-d
    cwd: './app-d'
    tasks:
      test: echo "running test from $(pwd)"
  
tasks:
  test: run the test suites
  build: build the application

Then create a lurkle.yml file in each sub-folder. Each lurkle can then provide a command for as many tasks as they need.

# example/app-a/lurkle.yml
name: app-a
tasks:
  test: echo 'test from app-a'

# example/app-b/lurkle.yml
name: app-b
tasks:
  test: echo 'test from app-b'
  build: echo 'build from app-b'

Running Tasks

We can now run our commands from the example folder.

Running lurkle --help will list each command.

lurkle [tasks] [-l optional list of lurkle locations]

| Command | Result | |-----------------------------------------------|-------------------------------------------------| |lurkle | Run all commands in all lurkles | |lurkle build | run the build command in all lurkles | |lurkle build test | run the build and test command in all lurkles | |lurkle build -l src/services/micro-service-b | run the build command in micro-service-b lurkle |

Services

Lurkle provides a start command that serves as a wrapper around pm2. This allows you to coordinate ENV vars and choose which services you would like to start.

Configuring Services

Each key on sites creates a new service to start. The value object is passed directly to pm2 so any [valid pm2 attribute] is allowed. To minimise re-declaring environment variables the root env object will be used as defaults for each service.

services:
  env:
    CLIENT_HOST: 'localhost'
    CLIENT_PORT: 3000
    SERVER_HOST: 'localhost'
    SERVER_PORT: 3001

  server:
    env:
      SERVER_ONLY_ENV: 12345
    cwd: server
    script: 'index.js'

  client:
  server:
    cwd: client
    script: 'index.js'

Starting Services

lurkle start [sites]

| Command | Result | |-----------------------------|------------------------------| |lurkle start | Start all sites | |lurkle start client | Start only the client | |lurkle start client server | Start the client and server |