Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "utils", | ||
"description": "Fast, generic JavaScript/node.js utility functions.", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"homepage": "https://github.com/jonschlinkert/utils", | ||
@@ -73,2 +73,11 @@ "author": { | ||
"keywords": [ | ||
"array", | ||
"collection", | ||
"function", | ||
"lang", | ||
"language", | ||
"math", | ||
"object", | ||
"object", | ||
"string", | ||
"util", | ||
@@ -75,0 +84,0 @@ "utils" |
126
README.md
@@ -5,2 +5,15 @@ # utils [![NPM version](https://badge.fury.io/js/utils.svg)](http://badge.fury.io/js/utils) [![Build Status](https://travis-ci.org/jonschlinkert/utils.svg)](https://travis-ci.org/jonschlinkert/utils) | ||
**Why another utils lib?** | ||
- I'm a node.js developer. I want fast, light, dependable utility functions for node.js projects. | ||
- Do you really need bloated, everything-but-the-kitchen-sink functions that are guaranteed to work with IE 4, **for your Yeoman generator or gulp plugin**!? Nonsense. | ||
- The benchmarks that accompany many of the functions in the library show that in some cases, the penalty for using such "kitchen-sink" code is a 2,000-5,000% reduction in speed. Sometimes greater. | ||
**Goals** | ||
- Fastest implementation of each method, without too much compromise. Covering uncommon cases is fine, but don't go overboard. | ||
- Clean well-documented, commented code. | ||
- [When it makes sense](#adding-utils), external libraries are used and exposed instead of writing new code. | ||
- Focus on node.js usage and projects that are likely to use a number of these utils in one project. If you only need one or two of these in a small project, don't use this. Use small modules that do only one thing. | ||
## Install with [npm](npmjs.org) | ||
@@ -17,7 +30,9 @@ | ||
- [Usage](#usage) | ||
- [Code coverage](#code-coverage) | ||
- [Code links](#code-links) | ||
- [API](#api) | ||
- [Code coverage](#code-coverage) | ||
- [Running tests](#running-tests) | ||
- [Contributing](#contributing) | ||
* [Adding utils](#adding-utils) | ||
* [Updating the docs](#updating-the-docs) | ||
* [Running verb](#running-verb) | ||
@@ -28,35 +43,40 @@ <!-- tocstop --> | ||
To get all utils grouped by collection: | ||
**Utils grouped by collection** | ||
The top level export gives you an object with utils grouped into collections, like `array`, `object`, `math`, etc: | ||
```js | ||
var utils = require('utils'); | ||
// All utils are on the `_` property | ||
console.log(utils._); | ||
//=> {array: {flatten: [function], ...}, collection: {...}} | ||
``` | ||
**Get a specific collection** | ||
See [example.md](./example.md) for visual representation of the object. | ||
**Get all utils on one object** | ||
If you want all utils on a single object (e.g. not grouped by collection): | ||
```js | ||
var utils = require('utils'); | ||
// get only the string utils | ||
var string = utils.string; | ||
// all utils are on the `_` property | ||
var utils = require('utils')._; | ||
``` | ||
## Code coverage | ||
**Only get a specific collection** | ||
If you just want the `string` or `object` utils: | ||
```js | ||
var string = require('utils').string; | ||
var object = require('utils').object; | ||
``` | ||
Statements : 99.72% ( 359/360 ) | ||
Branches : 97.4% ( 187/192 ) | ||
Functions : 100% ( 81/81 ) | ||
Lines : 99.68% ( 310/311 ) | ||
``` | ||
## Code links | ||
These links take you to the code for each function. There are currently 0 utils in 7 sub-categories: | ||
<!-- ## Code links | ||
These links take you to the code for each function. There are currently {%= codelinks('lib/', 'utils in 7 sub-categories:') %} --> | ||
## API | ||
## API | ||
_(The below API documentation is generated by [Verb]. )_ | ||
### [.after](./lib/array/after.js#L19) | ||
@@ -324,14 +344,2 @@ | ||
### [.isArguments](./lib/lang/isArguments.js#L18) | ||
Return true if the given `value` is an arguments object. | ||
* `value` **{*}**: The value to check. | ||
* `returns`: {Boolean} | ||
```js | ||
isArguments(arguments) | ||
//=> 'true' | ||
``` | ||
### [.isEmpty](./lib/lang/isEmpty.js#L37) | ||
@@ -722,2 +730,6 @@ | ||
## Code coverage | ||
Please help improve code coverage by [adding unit tests](#contributing). | ||
``` | ||
-----------------------|-----------|-----------|-----------|-----------| | ||
@@ -748,5 +760,4 @@ File | % Stmts |% Branches | % Funcs | % Lines | | ||
tryRequire.js | 80 | 100 | 100 | 80 | | ||
lang/ | 75 | 50 | 25 | 75 | | ||
lang/ | 87.5 | 100 | 50 | 87.5 | | ||
hasValues.js | 100 | 100 | 100 | 100 | | ||
isArguments.js | 50 | 25 | 0 | 50 | | ||
isEmpty.js | 66.67 | 100 | 0 | 66.67 | | ||
@@ -794,5 +805,6 @@ isObject.js | 100 | 100 | 100 | 100 | | ||
-----------------------|-----------|-----------|-----------|-----------| | ||
All files | 84.15 | 75.95 | 72.88 | 83.12 | | ||
All files | 84.55 | 77.27 | 75.44 | 83.55 | | ||
-----------------------|-----------|-----------|-----------|-----------| | ||
``` | ||
@@ -807,4 +819,33 @@ ## Running tests | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/utils/issues) | ||
> Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/utils/issues) | ||
### Adding utils | ||
If you want to do a PR to add a util, please read the following first: | ||
- follow the same coding style as the rest of the library, same with code comments | ||
- add sufficient unit tests | ||
- Install dev dependencies and [run verb](#running-verb) | ||
- Look over the README to make sure that verb rendered out the docs with your method and code comments. | ||
**Adding external modules as dependencies** | ||
- External modules will only be considered if they meet the same quality and coding standards as the rest of the library. At minimum this includes documentation, code comments, and unit tests. Benchmarks are also strongly preferred. | ||
### Updating the docs | ||
Do not edit the readme manually since [verb] is used to generate documentation. | ||
- API docs: If you see an error in the API documentation, just update the code comments for that method, then [run verb](#running-verb). | ||
- Everything else, please look over the [.verb.md](./.verb.md) template to see where the error is, then [run verb](#running-verb). | ||
### Running verb | ||
Run [verb] to generate documentation: | ||
```js | ||
npm i -d && verb | ||
``` | ||
## Author | ||
@@ -821,14 +862,3 @@ | ||
*** | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 25, 2015._ | ||
[assemble]: https://github.com/assemble/assemble | ||
[verb]: https://github.com/assemble/verb | ||
[template]: https://github.com/jonschlinkert/template | ||
[word-wrap]: https://github.com/jonschlinkert/word-wrap | ||
[helper-concat]: https://github.com/helpers/helper-concat | ||
[path]: https://nodejs.org/api/path.html | ||
<!-- deps:mocha jshint-stylish --> | ||
{%= reflinks('') %} | ||
<!-- deps:mocha jshint-stylish --> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
53510
855
0
69
1231