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

yalla-exec

v0.0.17

Published

[![Build Status](https://travis-ci.org/GuyMograbi/yalla-exec.svg?branch=master)](https://travis-ci.org/GuyMograbi/yalla-exec) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![MIT Lice

Downloads

8

Readme

Yalla-Exec

Build Status JavaScript Style Guide MIT Licence npm version

Manage commands alongside environment variables. Use configuration file.

Instructions

Install using

npm install -g yalla-exec

Create a file named .yalla.

Add configuration such as

module.exports = {
  demo : {
    cmd: 'echo hello ${YALLA_USERNAME}',
    env: {
      YALLA_USERNAME: 'YALLA!!'
    }
  }
}

Run command

yalla demo

You should see this output

hello YALLA!

Other configurations

Yalla also supports configuration in yaml, json and inside package.json

For yaml and json the filename should still be .yalla

Example - yaml

demo:
  cmd: 'echo hello'

Exmple - json

{
  "demo":{
    "cmd": "echo hello"
  }
}

and inside pakcage.json simply add a yalla property

{
  "name": "my-module",
  "version" : "0.0.0",
  "dependencies": {},
  "yalla": {
    "demo": {
      "cmd": "echo hello"
    }
  }
}

another option: directory .yalla - expected to only contain configuration files

List all commands

To get a list of all possible commands in the configuration you can simply run yalla in the command line

> yalla
demo

Passing flags from outside

Yalla uses minimist and lodash template to allow you to pass flags from outside

So for example the following definition

start:
  cmd: <%= argv.watch ? 'nodemon' : 'node' %> server.js

Allows you to pass the flag watch and run nodemon server.js instead of node server.js

The syntax <%= argv.watch %> is from lodash's template mechanism and the reference to argv and its structure is from minimist library syntax

Yalla exposes minimist's arguments on the variable argv for the template.

This combination allows you to easily declare different variations to your commands. It also allows defining lists and complex objects from your command line.

yalla --config.db_url="..." --config.cors_regex="..."

Will result in argv.config = { db_url: '...' , cors_regex: '...'}

FAQ

Where are my colors?

When I run the command directly - I see colors, but with yalla the colors are gone.. Why is that?

Answer

The reason this happens is some libraries auto-detect if the terminal (yalla in this case) supports color. To force colors, just add environment variable export FORCE_COLOR=1

See relevant thread: https://github.com/Marak/colors.js/issues/127

Changelist

  • October 4 2020 - add support for directories.

Roadmap

  • [X] support directories

  • [X] support object values for environment variables

  • [X] support JSON & Yaml configurations

  • [X] support passing flags from outside and declaring required/optional flags (especially for debug)

  • [X] make it a legit npm library. with github links, automated testing on a CI and license.

  • [X] support yalla files in parent directories

  • [X] support alternative working directories for commands

  • [ ] support 'watch' ability

  • [ ] support running multiple commands

    • so just an array of of commands should be enough.. we can silence the output with > /dev/null