# dc-utils

> JavaScript utilities.

Latest version **1.2.1** (published 2016-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install dc-utils
pnpm add dc-utils
yarn add dc-utils
bun add dc-utils
```

## 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.2.1 |
| Published | 2016-04-11 |
| First published | 2016-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Cortes |
| Maintainers | dcortes92 |
| Keywords | javascript, utilities, dc |

## Links

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

## Recent versions

- 1.2.1 (latest) — 2016-04-11
- 0.0.0-semantic-released — 2016-04-10
- 1.2.0 — 2016-03-19
- 1.1.0 — 2016-03-04
- 1.0.0 — 2016-03-04

## README

# dc-utils
[![Travis Build](https://img.shields.io/travis/dcortes92/dc-utils.svg?maxAge=2592000)](https://travis-ci.org/dcortes92/dc-utils)
[![Codecov](https://img.shields.io/codecov/c/github/dcortes92/dc-utils.svg?maxAge=2592000)](https://codecov.io/github/dcortes92/dc-utils)
[![npm](https://img.shields.io/npm/dm/dc-utils.svg?maxAge=2592000)](http://npm-stat.com/charts.html?package=dc-utils)
[![npm](https://img.shields.io/npm/v/dc-utils.svg?maxAge=2592000)](https://www.npmjs.com/package/dc-utils)

This library was created following the series *How to Write an Open Source JavaScript Library by @kentcdodds for egghead.io*

## Installation

`npm install -g dc-utils`

## Usage

```javascript
var dc = require('dc-utils')

// check if an array
dc.isArray(['2', 'a', '4']) //true
dc.isArray(42) //false

// sorting an array
var arr = [7, 5, 3, 10, 6, 1 ,8]
dc.sort(arr) // [1, 3, 5, 6, 7, 8, 10]
dc.sort(42) // []

// sorting using a comparisson function
var arr = [
    { first: 'daniel', last: 'cortes' },
    { first: 'tim', last: 'drake' },
    { first: 'bruce', last: 'wayne' },
    { first: 'kate', last: 'kane'}
]

arr.sort(dc.by('first')) 
// output:
// [ { first: 'bruce', last: 'wayne' },
//   { first: 'daniel', last: 'cortes' },
//   { first: 'kate', last: 'kane'},
//   { first: 'tim', last: 'drake' }
// ]

```

## Attribution
The code used by this library was adapted from the book "_Javascript: The Good Parts by Douglas Crockford._"

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