open-index/open-npm huggingface dataset:
npm package: @karimsa/boa
Description: Toolkit for building backends in Node.js.
Latest version: 0.1.0

# boa [![CircleCI](https://circleci.com/gh/karimsa/boa.svg?style=svg)](https://circleci.com/gh/karimsa/boa)

Toolkit for building backends in Node.js.

- [Configuration](#configuration)
- [Logger](#logger)

## Configuration

- **Read string environment variable**: `Config.string('Redis.Password')` - This will read the environment variable `REDIS_PASSWORD` and will error out if the value is empty.
- **Read string environment variable with default value**: `Config.string('Redis.Password', 'blah')` - This will try to read the environment variable `REDIS_PASSWORD` and will return `blah` if the value is empty.
- **Read integer environment variable**: `Config.int('Redis.Port')` - This will read the environment variable `REDIS_PORT` and try to cast it to an integer. If the casting fails or the value is empty, it will fail.

Preloaded variables:

- `Config.NodeEnv` -> `process.env.NODE_ENV`
- `Config.isTestEnv` -> `true` if `NODE_ENV` is set to `test`.
- `Config.isDevelopmentEnv` -> `true` if `NODE_ENV` is set to `development`.

## Logger

![](.github/logger.png)

The exported logger is a wrapper around a hidden winston logger, which by default logs to the console. The logging levels can be configured using the environment variable `LOGGER_LEVEL` - the default is to log `warn` and above. The levels are as follows:

- `error`
- `warn`
- `info`
- `verbose`

All loggers use `util.format()` & therefore whatever formatters are supported by your node version (see [docs](https://nodejs.org/api/util.html#util_util_format_format_args)).

The logger also comes with some extra builtin utilities:

- **errorf**: creates an error object where the message is formatted using the formatter.
- **fatalf**: builds an error using `errorf()` then throws it.
- **debug**: takes a namespace as the first parameter and only logs the formatted message if that namespace is enabled using `process.env.DEBUG`.

```javascript
import { logger } from '@karimsa/boa'

// errorf
const name = await fetchName()
const err = logger.errorf('Hello, %s', name)
// err = new Error('Hello, ' + name)

// fatalf
logger.fatalf('hello') // throw logger.errorf('hello')

// debug
logger.debug('myapi', 'hello, %s', name)
```

## License

Licensed under MIT license.

Copyright (C) 2019-present Karim Alibhai.
npm package: @karimsa/mono
Description: Monorepo helper for JavaScript.
Latest version: 0.1.1

# @karimsa/mono [![CircleCI](https://circleci.com/gh/karimsa/mono.svg?style=svg)](https://circleci.com/gh/karimsa/mono)

Monorepo helper for JavaScript.

## Usage

To get started, you don't have to do anything. As long as your project follows the typical JS monorepo structure of having projects under `packages/` - you should be good to go.

To run a cross-project `npm install`, simply do `npx @karimsa/mono` (you don't have to install this package, it should download quite fast with npx given that it has no dependencies & it is really small).

Here's some other things you can do:

 - **Build all your packages:** `npx @karimsa/mono run build`
 - **Run all tests**: `npx @karimsa/mono test`
 - **Start all dev servers**: `npx @karimsa/mono start`
 - **Link all libraries**: `npx @karimsa/mono link` (`install` will also run `link` after)

## `start`

The `start` command in `@karimsa/mono` is a bit different from the other commands. Most commands will simply run the correct commands in each project directory, but `start` will concurrently run `start` across all projects that support it. This means that you can run all your dev servers in parallel, since this is the typical use case for `start`.

## `link`

The `link` command will create require shortcuts in all repositories to all other packages. For instance, if you have the following directory structure:

```
packages
 |--- a
 |--- b
```

Then running `npx @karimsa/mono link` will make it so that you can `require('a')` inside of `b` and `require('b')` inside of `a`. The require links the module directly rather than making a copy so changes will always be reflected when you do a `require()`.

## License

Licensed under the MIT license.

Copyright &copy; 2019-present Karim Alibhai. All rights reserved.
npm package: @karimsa/pull
Description: Download files using HTTP range transfers.
Latest version: 0.0.2

# @karimsa/pull

Download files using HTTP range transfers.

## Usage

Install via npm - `npm install -g @karimsa/pull` or use via npx `npx @karimsa/pull`.

```bash
$ pull "http://mydomain.com/large-file.zip"
```

To see a help message, use `pull --help`.

## License

Licensed under MIT license.

Copyright &copy; 2019-present Karim Alibhai.