open-index/open-npm huggingface dataset:
npm package: @jsmney/minitools
Description: Library of helper functions in JavaScript
Latest version: 2.3.1

# Jasmine's personal NPM JS Utility library

[![npm(scoped)](https://img.shields.io/npm/v/@jsmney/minitools)](https://www.npmjs.com/package/@jsmney/minitools)
[![install size](https://packagephobia.now.sh/badge?p=@jsmney/minitools)](https://packagephobia.now.sh/result?p=@jsmney/minitools)
![license](https://img.shields.io/npm/l/@jsmney/minitools)
![top language](https://img.shields.io/github/languages/top/jsmney/2020-04-17-personal-npm-package)

Created in April 2020 in participation of a Mintbean Hackathon.
[github](https://github.com/jsmney/2020-04-17-personal-npm-package)

## Install

`$ npm install @jsmney/minitools`

## Usage

```javascript
const mini = require('@jsmney/minitools')

// adds one!
mini.addOne(3) // 4

// emulates behavior of the infamous [left-pad](https://www.npmjs.com/package/left-pad)

mini.leftPad('hello', 10) // '     hello'
mini.leftPad(100, 10, '0') // '0000000100'
mini.leftPad(100, 1, '0') // Error: cannot pad, argument is too long

// leftPad, but for all elements in an array
mini.leftPadAll(['hi', 'hello', 'greetings', 'yo'], 15)
// [
//   '             hi',
//   '          hello',
//   '      greetings',
//   '             yo'
// ]

// Happy Number checker!
mini.isHappy(19) // true
mini.isHappy(20) // false
```

## Example execution on RunKit

Check it out on my [RunKit playground](https://runkit.com/jsmney/5e99eff44dbf5a00133ebab7)

## Requirements

1. Create a personal [npm](https://npmjs.com) library.
1. Fill it with methods you would find useful in future projects.
1. Publish it to `npm` (you may have to sign up for an `npm` account).
1. Demonstrate that it can be `require`d right from `npm`, by building a project using Runkit or Codepen

## Resources

- I found [freeCodeCamp's Tutorial](https://www.freecodecamp.org/news/how-to-make-a-beautiful-tiny-npm-package-and-publish-it-2881d4307f78/) SUPER helpful :)

### Additional Links

- [Creating and publishing unscoped public packages](https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages)
- [Video - Creating & publishing your own NPM modules](https://www.youtube.com/watch?v=rTsz09zRuTU)
- [Testing npm modules locally](https://www.youtube.com/watch?v=YBy5qIsrOyk)
- [npm-link](https://docs.npmjs.com/cli/link.html)

### For future reference ( as I grow this... )
- [npm for react](https://medium.com/@BrodaNoel/how-to-create-a-react-component-and-publish-it-in-npm-668ad7d363ce)
- [es6 modules on the front end](https://wesbos.com/javascript-modules/)
npm package: @jsmonday/imgproxy
Description: ImgProxy Library for Node.js that works both on browser and server
Author: Michele Riva
Latest version: 0.1.0

<img src="/docs/cover.png?v=2" />
<a href="https://opencollective.com/jsmonday" target="_blank">
  <img src="https://opencollective.com/jsmonday/tiers/one-shot-donation.svg?avatarHeight=60&width=600" />
</a><br />

**JavaScript** library for generating **ImageProxy** urls **both on browser and server**.

# Installation

```bash
npm i -s @jsmonday/imgproxy
# or
yarn add @jsmonday/imgproxy
```

# Usage

```js
import ImgProxy from "@jsmonday/imgproxy";

const proxy = new ImgProxy({ 
  key:  process.env.IMGPROXY_KEY, 
  salt: process.env.IMGPROXY_SALT, 
  url:  process.env.IMGPROXY_URL
});

const myResizedImage = proxy
                        .image("https://example.com/img.jpg")
                        .width(500)
                        .height(500)
                        .extension("png")

console.log(myResizedImage.get()); // => "<imgproxy url>"

```

# Methods
`@jsmonday/imgproxy` currently does not support all the **imgproxy** methods (it will do in the near future).

- `.image(<string>)`: The image to be resized
- `.width(<number>)`: Resize Width
- `.height(<number>)`: Resize height
- `.extension(<string>)`: The resized image extension
- `.gravity(<string>)`: The resize gravity
- `.enlarge(<number>`: Enlarge image
- `.resizeType(<string)`: The resize type


# License
[MIT](/LICENSE.md)
npm package: @jsmrcaga/discord
Description: A very simple discord client
Author: Jo Colina
Latest version: 0.0.3

# @jsmrcaga/discord

_Very_ simple Discord messaging client.

## tl;dr

* [Official `Gateway` docs](https://discordapp.com/developers/docs/topics/gateway) 
* [Events](https://discordapp.com/developers/docs/topics/gateway#commands-and-events-gateway-events)

```js
const discord = require('@jsmrcaga/discord');

// Executes `Identify` command on its own
// Handles `Resume`, `Heartbeat` automatically
let bot = new discord({
	identify: {
		token: '<your bot token>'
	}
});

// GENERIC
bot.on('connected', () => {
	// Fires after WebSocket connected, Identify is performed and Heartbeat started
	console.log(`I'm connected!`);
});

// MESSAGES
bot.on('message', (event) => {
	// Fires whenever a new message is created/updated/deleted
});

// COMMANDS
bot.on('command', ({ command, data }) => {
	// Fires for any command, does not parse args
});

bot.command('!comm', ({ args, data }) => {
	// Fires for specific event with ! (bang), parses args as terminal args
});

bot.command('/comm', ({ args, data }) => {
	// Fires for specific event with / (slash), parses args as terminal args
})

// GUILD
bot.on('guild', guild => {
	// Fires on GUILD_CREATED, whenever a guild connects to this bot (or the bot restarts!)
});

// PRESENCE
bot.on('presence', data => {
	// Fires on user perence update
});

bot.on('ANY_NON_SUPPORTED_EVENT', data => {
	/*
		Example:
		bot.on('MESSAGE_UPDATE', data => ());
	*/
});

// Very basic messages for now
bot.message({
	channel: channel_id,
	content: 'Hello!'
}).then(({ status, headers, response }) => {

}).catch(e => {

});
```
npm package: @jsmrcaga/json.minify
Description: A simple package aiming to make small json arrays from json objects
Author: Jo Colina
Latest version: 0.0.1

# json.minify

Converts JSON objects into arrays, minimizing them a lot!

> ⚠️ be careful, this library does not check for differences in schemas and is mainly aimed to APIs 
> in which all objects returned are the same. If you pass arrays with different schemed objects, they
> will not be checked against values, causing weird and unexpected results (specially on `explode`)

## Installation
`npm i json.minify`

## Usage

```
const jsonMinifier = require('json.minify');

// or

const { minify, explode } = require('json.minify');

// you can add .minify() and .explode() to global JSON by using:
jsonMinifier();

let objs = [{
	prop1: 'test11',
	prop2: 'test12',
	subProp: {
		sub1: true,
		sub2: 35
	}
}, {
	prop1: 'test21',
	prop2: 'test22',
	subProp: {
		sub1: false,
		sub2: 'I AM THE PROP'
	}
}, {
	prop1: 'test31',
	prop2: 'test32',
	subProp: {
		sub1: 'sub sub sub',
		sub2: 'yup'
	}
}];

let result = json.minify(objs);

// results in
result = [
	['prop1', 'prop2', ['subProp', 'sub1', 'sub2']], //keys
	['test11', 'test12', [true, 35]], //values
	['test21', 'test22', [false, 'I AM THE PROP']],
	['test31', 'test32', ['sub sub sub', 'yup']]
];

// and
json.explode(result);

// results in the same objs array
npm package: @jsmrcaga/keep
Description: A simple password manager 
Author: Jo Colina
Latest version: 0.5.2

<p align="center"><img width="150px" src="https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/vault_9cmw.svg"/></p>

# Keep

A simple credential management solution.

## Roadmap
* [X] Simple user and credential management
* [X] Credential encrypting server-side (with 2nd encrypting password/certif)
* [X] Front end
* [X] Front end only encryption
* [ ] OTP Management
* [ ] Web authentication (fingerprint)

## Installation
`keep` works as a CLI to make it easy to launch. In order to install it just run

`npm i -g @jsmrcaga/keep`

You should now have access to the CLI.

## CLI
* Start:
`keep start [--config ./config.json] [--port 1234]`

> Note that if no config is specified, `./config.json` will be used as a default

## API
You can also use it via its API:

```js
const keep = require('@jsmrcaga/keep');

keep.start({ port: 1234 }, configFile).then(() => {
	// do something
}).catch(e => {
	// handle the error
});
```

> Please note that when using as an API `keep` will not register global
> error handling. When launched via the CLI it will via `process.on('unhandledRejection')` and `process.on('uncaughtError')`.

## Requirements
* Database:
Keep uses MongoDB along with `@jsmrcaga/mongo`. You should be able to launch it just by specifiying your config via the API or the cli.

## Configuration
Example:

> Note that under `db` all properties will be forwarded to `@jsmrcaga/mongo`

```
{
	"db": {
		"username": "",
		"password": "",
		"port": 23456
	}
}
```
npm package: @jsmrcaga/monitor
Description: A simple server monitor app, filled with nice stuff
Author: Jo Colina
Latest version: 0.0.6

# monitor
A simple & straightforward server/pc monitor;

## Installation
If you haven't yet, install NodeJS and npm (tons of tuts online)

`npm i -g @jsmrcaga/monitor`

(depending on settings, `sudo` might be required)

## Usage
`monitor` will launch a server to monitor and log to the terminal.

To launch monitor without logs, simply use `monitor &`

## API

## GET `/perfs`
Returns all performance information and host general information :

```
{
	// RAM with free -m
	"ram": {
		"total":,
		"used":,
		"free":,
		"shared":,
		"buffer":,
		"available":,
		"usage": <percent>
	},

	// os.cpus()
	"cpu": {
		"cpus": [
			{
				"model": "Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz",
				"speed": 2300,
				"times": {
					"user": 111715970,
					"nice": 0,
					"sys": 113884460,
					"idle": 595231360,
					"irq": 0
				},
				"usage": 0.2748436802137013
			},
			...
		],
		"global": {
			"user": 325727140,
			"nice": 0,
			"sys": 297567490,
			"idle": 2659961710,
			"irq": 0,
			"usage": 0.1898403796275011
		}
	},

	// disk from df -m
	"disk": {
		"blocks": "115411",
		"used": "83387",
		"usage": 0.000009999970972777843,
		"available": "24205",
		"mounted": "2272833"
	},

	// os.networkInterfaces() + ipify.org for external
	"ip": {
		"ipv4": {
			"address": "xxx.xxxx.xx.x",
			"netmask": "255.255.255.0",
			"family": "IPv4",
			"mac": "00:00:00:00:00:00",
			"internal": false,
			"cidr": "xxx.xxx.xx.x/24"
		},
		"ipv6": {
			"address": "yyyy::zzzz:zzzz:zzzz:zzzz",
			"netmask": "ffff:ffff:ffff:ffff::",
			"family": "IPv6",
			"mac": "00:00:00:00:00:00",
			"scopeid": 12,
			"internal": false,
			"cidr": "fe80::db97:b69a:4053:fdcc/64"
		},
		"external": {
			"address": "xxx.xxx.xxx.xxx"
		}
	},

	// os.uptime()
	"uptime": 1918514000,

	// multiple process and os functions
	"info": {
		"node": "v10.12.0",
		"platform": "darwin",
		"env": "development",
		"uname": "Darwin XXXXXXXXXXX 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct  5 19:41:49 PDT 2018;",
		"architecture": "x64",
		"hostname": "your-hostname",
		"osrelease": "18.2.0"
	}
}
```

## GET `/perfs/ram`
Returns all RAM information

## GET `/perfs/cpu`
Returns all CPU information

## GET `/perfs/disk`
Returns all Disk information

## GET `/perfs/info`
Returns all OS information