keystonejs / keystone-utils

⚠️ Archived - Legacy Node.js utility library used by KeystoneJS and you!
http://keystonejs.com
MIT License
56 stars 20 forks source link

⚠️ Archived

This repository is archived and is no longer maintained.

For the latest Keystone release please visit the Keystone website.



Keystone Utils

A useful library of utilities for node.js used by KeystoneJS and you!

It provides additional functionality for manipulating and converting various types of data, including converting strings between various forms, and lightweight html ← → text conversion.

Usage

npm install keystone-utils --save

... then ...

var utils = require('keystone-utils');
console.log(utils.isObject({})); // true!

Bundled with KeystoneJS

If you're using KeystoneJS, it exposes this library as .utils.

var keystone = require('keystone');
var utils = keystone.utils;

Test utilities

Option utilities

Function utilities

Random utilities

Conversion utilities

Credits

Uses the inflect library for singular / plural conversion, see https://github.com/pksunkara/inflect or npm info i

Some utils are borrowed from / inspired by mongoose/utils.js, see https://github.com/LearnBoost/mongoose

HTML Entity encode / decode is based on code in node-html-to-text, see https://github.com/werk85/node-html-to-text

The transliteration code is based on https://www.npmjs.org/package/transliteration.cyr