<commit_before># constantinople

Determine whether a JavaScript expression evaluates to a constant (using UglifyJS).  Here it is assumed to be safe to underestimate how constant something is.

[![Build Status](https://travis-ci.org/ForbesLindesay/constantinople.png?branch=master)](https://travis-ci.org/ForbesLindesay/constantinople)
[![Dependency Status](https://gemnasium.com/ForbesLindesay/constantinople.png)](https://gemnasium.com/ForbesLindesay/constantinople)
[![NPM version](https://badge.fury.io/js/constantinople.png)](http://badge.fury.io/js/constantinople)

## Installation

    npm install constantinople

## Usage

```js
var isConstant = require('constantinople')

if (isConstant('"foo" + 5')) {
  console.dir(isConstant.toConstant('"foo" + 5'))
}
if (isConstant('Math.floor(10.5)', {Math: Math})) {
  console.dir(isConstant.toConstant('Math.floor(10.5)', {Math: Math}))<commit_msg>Use http://shields.io for README badges.<commit_after># constantinople

Determine whether a JavaScript expression evaluates to a constant (using UglifyJS).  Here it is assumed to be safe to underestimate how constant something is.

[![Build Status](https://img.shields.io/travis/ForbesLindesay/constantinople/master.svg)](https://travis-ci.org/ForbesLindesay/constantinople)
[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/constantinople.svg)](https://gemnasium.com/ForbesLindesay/constantinople)
[![NPM version](https://img.shields.io/npm/v/constantinople.svg)](http://badge.fury.io/js/constantinople)

## Installation

    npm install constantinople

## Usage

```js
var isConstant = require('constantinople')

if (isConstant('"foo" + 5')) {
  console.dir(isConstant.toConstant('"foo" + 5'))
}
if (isConstant('Math.floor(10.5)', {Math: Math})) {
  console.dir(isConstant.toConstant('Math.floor(10.5)', {Math: Math}))
{'fraction_non_alphanumeric': 0.1622210125204137, 'fraction_numerical': 0.008709853021230268, 'mean_word_length': 6.069230769230769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6214823', 'n_tokens_mistral': 644, 'n_tokens_neox': 608, 'n_words': 109}