# mike-node

> A bunch of shortcuts I often use

Latest version **1.0.9** (published 2017-04-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install mike-node
pnpm add mike-node
yarn add mike-node
bun add mike-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2017-04-14 |
| First published | 2017-03-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Known vulnerabilities | 0 (+15 in 5 direct dependencies) |
| Install scripts | no |
| Author | Mike del Castillo |
| Maintainers | mikedelcastillo |
| Keywords | mike, mike del castillo, pug, sass, css, html, pretty, beautify, compress, resize, workspace, environment, cheese, autoprefix, jesus |

## Links

- npm: https://www.npmjs.com/package/mike-node
- npm.io page: https://npm.io/package/mike-node

## Dependencies (17)

- [pug](https://npm.io/package/pug.md) ^2.0.0-beta11
- [path](https://npm.io/package/path.md) ^0.12.7
- [sharp](https://npm.io/package/sharp.md) ^0.17.3
- [postcss](https://npm.io/package/postcss.md) ^5.2.16
- [fs-extra](https://npm.io/package/fs-extra.md) ^2.1.2
- [imagemin](https://npm.io/package/imagemin.md) ^5.2.2
- [is-image](https://npm.io/package/is-image.md) ^1.0.1
- [node-sass](https://npm.io/package/node-sass.md) ^4.5.2
- [image-size](https://npm.io/package/image-size.md) ^0.5.1
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.6.12
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^6.7.7
- [pug-php-filter](https://npm.io/package/pug-php-filter.md) 0.0.1
- [imagemin-optipng](https://npm.io/package/imagemin-optipng.md) ^5.2.1
- [imagemin-jpegtran](https://npm.io/package/imagemin-jpegtran.md) ^5.0.2
- [imagemin-pngquant](https://npm.io/package/imagemin-pngquant.md) ^5.0.0
- [imagemin-jpeg-recompress](https://npm.io/package/imagemin-jpeg-recompress.md) ^5.1.0
- [jstransformer-markdown-it](https://npm.io/package/jstransformer-markdown-it.md) ^2.0.0

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 1.0.9 (latest) — 2017-04-14
- 1.0.8 — 2017-04-12
- 1.0.7 — 2017-04-11
- 1.0.6 — 2017-04-10
- 1.0.5 — 2017-04-10
- 1.0.4 — 2017-04-10
- 1.0.3 — 2017-04-10
- 1.0.2 — 2017-04-10
- 1.0.1 — 2017-04-10
- 0.0.24 — 2017-04-06
- 0.0.23 — 2017-04-06
- 0.0.22 — 2017-04-06
- 0.0.21 — 2017-04-05
- 0.0.20 — 2017-04-05
- 0.0.19 — 2017-04-05
- … 19 more at https://npm.io/package/mike-node/versions

## README

# About Me
Hi, I'm a 19-year-old web developer from the Philippines taking Information Technology Entrepreneurship at Ateneo de Manila University.
So, I see you've stumbled upon my node package. *Hmmmm*, I don't really have time to say much right now but I'll try my best to document everything.

##### Want to get in touch with me?
Contact me here: johnmichaeldc@gmail.com. Visit my website too mikedelcastillo.github.io.

# What is this?

This is a package that combines a lot of the packages I use and houses lots of methods that just make life a little easier for me.

Some highlights about this package
- Most functions are executed synchronously.
- Easy use with JSON – reading, writing, parsing & stringifying.
- Easy Pug compiling with PHP filter support.
- SASS rendering along with CSS autoprefixing.
- Easier handling of files and directories.
- CSS and HTML files are beautified by default since Pug and SASS doesn't really do a good job at that.
- Recursively compresses and resizes all images in a directory.


# Use
Run `npm install mike-node` in Terminal or what ever lel and put this in your JavaScript file.
```js   
var mike = require('mike-node');
```
# Methods
Olrayt lets get on with it.

### mike.mkdir(path)
This `mkdir` differs from `fs`'s or `fs-extra`'s as it creates all the directories that lead up to the last directory in the `path` argument. This means passing `"some/body/once"` to the function will create 3 folders that take the structure of the path if those directories dont exist.

### mike.write(file, content)
Self-explanatory; this writes a file with the 2nd argument as its content. This calls the `mkdir` function on the directory leading up to the file's directory to make sure the file gets written. The example below will auto-create the folders if they dont exist and will write the file as well with the right content.
```js
mike.write("some/body/once/told.me", "the world");
```

### mike.read(file)
Self-explanatory.

### mike.ls(path)
Returns an array of all the files and folders in a directory.

### mike.exists(path)
### mike.file(file)
### mike.dir(path)
### mike.copy(input, output, obj)
### mike.empty(path)
### mike.watch(path, callback)
### mike.sweep(path)

### mike.json
### mike.json.parse(string)
### mike.json.stringify(string)
### mike.json.read(file)
### mike.json.write(file, object)

### mike.csv
### mike.csv.parse(string, object)
```js
var array = mike.csv.parse(csv, {
  useHeaders: true,
  toJSON: true,
  pretty: true,
  parseBoolean: true,
  parseNumber: true,
  separator: ","
});
```

### mike.beautify
### mike.beautify.html(html)
### mike.beautify.css(css)

### mike.pug
### mike.pug.compile(file, options)
### mike.pug.write(file, options, path, data)

### mike.css
### mike.css.autoprefix(css)

### mike.sass
### mike.sass.render(file)
### mike.sass.write(file, path)
### mike.sass.files(input, output)
### mike.sass.watch(input, output)

### mike.img
### mike.img.is(file)
### mike.img.size(file)
### mike.img.resize(file, a, b, c, d)
### mike.img.compress(file, path, callback)

### mike.imgs
### mike.imgs.resize(input, output)
### mike.imgs.compress(input, output)
### mike.imgs.resize(input, output, versions, callback)
### mike.imgs.resizeAndCompress(input, output, versions)
```js
{
  prefix: ___,
  affix: ___,
  width: ___,
  height: ___,
  size: ___,
  maxSize: ___
}
```
Example use case
```js
mike.empty("img");

mike.imgs.resizeAndCompress("oimg", "img", [
  {
    affix: "-small",
    maxSize: 200
  },
  {
    affix: "-medium",
    maxSize: 500
  },
  {
    affix: "-large",
    maxSize: 1920
  },
  {
    maxSize: 9999
  }
]);
```

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