# morral

> A bag of small tools for node.js scripts

Latest version **0.1.1** (published 2016-10-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install morral
pnpm add morral
yarn add morral
bun add morral
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-10-04 |
| First published | 2016-10-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Oscar Ponce |
| Maintainers | wigahluk |
| Keywords | node, javascript |

## Links

- npm: https://www.npmjs.com/package/morral
- Repository: https://github.com/wigahluk/morral
- Homepage: https://github.com/wigahluk/morral#readme
- Issues: https://github.com/wigahluk/morral/issues
- npm.io page: https://npm.io/package/morral

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-10-04
- 0.1.0 — 2016-10-03

## README

# morral.js

A bag of small tools for node.js scripts

## Logger

A color logger:

```javascript
const cli = require('morral').logger('My App'); // Configure the logger with the name of your app
// Use it like you use console.log
cli.log('This is just a string.'); // 2016-10-03 17:14:17 [My App] This is just a string with "log". 
```
To disable colors just send `--no-colors` as a *node* or *npm* argument.

## Git

Some information for the git repo (depends on the git command line tools):

```javascript
const morral = require('./src/morral');
const cli = morral.logger('Morral');
const git = morral.git;

git.branch((err, b) => {cli.log(`Branch: ${b}`)}); // 2016-10-03 17:43:08 [Morral] Branch: master
git.sha((err, b) => {cli.log(`SHA: ${b}`)}); // 2016-10-03 17:43:08 [Morral] SHA: 2d78611

```

## Traverse

Will invoke a callback on each file and directory of a given path.
Invocation on directories is done twice, one on entering the directory and one more after all the content
has been processed.

```javascript
const fs = morral.fs;
fs.traverse(process.cwd(), (err, s) => {cli.log(s); });
// 2016-10-03 18:32:28 [Morral] {'path': '.../morral', 'isDirectory': true, 'exit': false}
// ...
// 2016-10-03 18:32:28 [Morral] {'path': '.../morral/src', 'isDirectory': true, exit: true}
// 2016-10-03 18:32:28 [Morral] {'path': '.../morral', 'isDirectory': true, exit: true}
```

---
_Source: https://npm.io/package/morral · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
