# @khalidhoffman/kdev-utils

> A cli/gulp library for quicker front-end development

Latest version **4.2.0** (published 2018-07-29) · 0 weekly downloads

## Install

```sh
npm install @khalidhoffman/kdev-utils
pnpm add @khalidhoffman/kdev-utils
yarn add @khalidhoffman/kdev-utils
bun add @khalidhoffman/kdev-utils
```

Provides the command `kdev`.

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2018-07-29 |
| First published | 2018-07-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 39 |
| Unpacked size | 86.7 KB |
| Known vulnerabilities | 0 (+11 in 4 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | khalidhoffman |

## Links

- npm: https://www.npmjs.com/package/@khalidhoffman/kdev-utils
- Repository: https://github.com/khalidhoffman/kdev-utils
- Homepage: https://github.com/khalidhoffman/kdev-utils#readme
- Issues: https://github.com/khalidhoffman/kdev-utils/issues
- npm.io page: https://npm.io/package/@khalidhoffman/kdev-utils

## Dependencies (39)

- [mz](https://npm.io/package/mz.md) ^2.6.0
- [nib](https://npm.io/package/nib.md) ^1.1.0
- [pug](https://npm.io/package/pug.md) ^2.0.0-rc.3
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [gulp](https://npm.io/package/gulp.md) ^3.9.1
- [less](https://npm.io/package/less.md) ^2.7.1
- [yargs](https://npm.io/package/yargs.md) ^8.0.2
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [lodash](https://npm.io/package/lodash.md) ^4.6.1
- [prompt](https://npm.io/package/prompt.md) ^1.0.0
- [bourbon](https://npm.io/package/bourbon.md) ^4.2.7
- [cssnano](https://npm.io/package/cssnano.md) ^3.8.0
- [php2pug](https://npm.io/package/php2pug.md) ^0.3.1
- [postcss](https://npm.io/package/postcss.md) ^5.0.19
- [webpack](https://npm.io/package/webpack.md) ^3.5.5
- [fs-extra](https://npm.io/package/fs-extra.md) ^4.0.1
- [node-sass](https://npm.io/package/node-sass.md) ^4.9.2
- [requirejs](https://npm.io/package/requirejs.md) ^2.3.5
- [socket.io](https://npm.io/package/socket.io.md) ^1.3.7
- [babel-core](https://npm.io/package/babel-core.md) ^6.7.4
- [pug-bemify](https://npm.io/package/pug-bemify.md) ^1.0.4
- [sass-cache](https://npm.io/package/sass-cache.md) 0.0.1
- [stylus-bem](https://npm.io/package/stylus-bem.md) ^0.54.10
- [superagent](https://npm.io/package/superagent.md) ^3.6.0
- [js-beautify](https://npm.io/package/js-beautify.md) ^1.5.10
- [kouto-swiss](https://npm.io/package/kouto-swiss.md) ^0.12.0
- [node-compass](https://npm.io/package/node-compass.md) ^0.2.4
- [pug-beautify](https://npm.io/package/pug-beautify.md) ^0.1.1
- [pug-bem-lexer](https://npm.io/package/pug-bem-lexer.md) 0.0.9
- [pug-plugin-ng](https://npm.io/package/pug-plugin-ng.md) 0.0.2
- [compass-mixins](https://npm.io/package/compass-mixins.md) ^0.12.10
- [pug-php-filter](https://npm.io/package/pug-php-filter.md) 0.0.1
- [avocode-toolkit](https://npm.io/package/avocode-toolkit.md) git+https://github.com/khalidhoffman/avocode-toolkit.git
- [stylus-type-utils](https://npm.io/package/stylus-type-utils.md) 0.0.3
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.9.0
- [stylus-bem-evaluator](https://npm.io/package/stylus-bem-evaluator.md) 0.0.5
- [postcss-discard-duplicates](https://npm.io/package/postcss-discard-duplicates.md) ^2.0.1
- [stylus-require-css-evaluator](https://npm.io/package/stylus-require-css-evaluator.md) 0.0.1
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) ^6.8.0

## Recent versions

- 4.2.0 (latest) — 2018-07-29
- 4.1.1 — 2018-07-29
- 4.1.0 — 2018-07-29
- 4.0.0 — 2018-07-29

## README

# kdev-utils [![Build Status](https://travis-ci.org/weblee-solutions/weblee-utils.svg?branch=master)](https://travis-ci.org/weblee-solutions/weblee-utils)
A cli/gulp library for quicker front-end development

#### How To Use
1. run `npm i -g @khalidhoffman/kdev-utils` for `kdev` cli (or without `-g` via package.json script).
2. Run `kdev` from root folder to see list of tasks.
3. Run `kdev setup` to generate project `kdev.config.json` file
 
#### Example Config
```
{
  "name": "project_name"
  "avocode" : {
      "userSelector": "User's Full Name",
      "projectSelector": "Project_name_to_match_against"
  },
  "workingDir" "/an/absolute/path|default|wordpress",
  "tasks" : [
    {
      "name" : "stylus",
      "input": "relative/path/to/stylus/folder/from/workingDir",
      "output": "relative/path/to/stylesheets/folder/from/workingDir"
    },
    {
      "name" : "pug-php",
      "input": "relative/path/to/pug/folder/from/workingDir",
      "output": "relative/path/to/php/folder/from/workingDir",
      "options": {
        "pretty": true
      }
    },
    {
      "name" : "jsx",
      "input": "relative/path/to/jsx/folder/from/workingDir",
      "options": {
        "ignore": ["glob/pattern/to/ignore", "**/node_modules/**"]
       }
    }
  ]
}
```
 

##### Config Details
* All paths are relative to `workingDir`. `workingDir` is an absolute path.
* `workingDir` when set to `"default"`, uses the `process.cwd()` (the current working directory)
* `jsx`, `stylus`, `less`, and `js` tasks support `options.ignore` field which is a [glob pattern](https://github.com/isaacs/node-glob#glob-primer) to exclude

###### Task Options

Task Names    | Details
--------------|---------
`pug-php`     | [additional helper functions](lib/pug/templates/_functions.pug) are saved  and included before compilation. compiles to `.php` files
`pug-ejs`     | [additional helper functions](lib/pug/templates/_functions.pug) are saved  and included before compilation. compiles to `.ejs` files
`pug-html`    | [additional helper functions](lib/pug/templates/_functions.pug) are saved  and included before compilation. compiles to `.html` files
`stylus`      | [additional helper functions](lib/stylus/templates/) are included at compilation. compiles to css
`stylus-bem`  | [additional helper functions](lib/stylus/templates/) are included at compilation. compiles to css. Read more about [stylus-bem](https://github.com/khalidhoffman/stylus-bem)
`sass`        | compiles to css
`compass`     | compiles to css
`less`        | compiles less to css. will prompt for filename.
`css`         | minifies css with cssnano. Will rewrite files with `.min.css` extension. Accepts path to single file or folder relative to workingDir for input
`js`          | beautifies js, overwriting file
`rjs`         | bundles and minfies with requirejs. input path should be a path to a requirejs config `build.js`
`webpack`     | bundles with webpack. input path should be a path to a webpack config file
`jsx`         | compiles to `.js` in same directory as original `.jsx` file
`html2pug`    | compiles `.html` files to `.pug` files
`php2pug`     | compiles `.php` files to `.pug` files
`ts/clean`    | removes typescript build files (`.js`, `.d.ts`)

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