Skip to content

Commit

Permalink
rename eson
Browse files Browse the repository at this point in the history
ejson looks really ugly when you see it lots
the j stands out too much
  • Loading branch information
tj committed Mar 22, 2012
1 parent ceceeee commit 62f9a09
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test:
--reporter $(REPORTER)

test-cov: lib-cov
EJSON_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
ESON_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html

lib-cov: lib
jscoverage $< $@
Expand Down
46 changes: 23 additions & 23 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

# ejson
# eson

Extended JSON for node.

## Installation

```
$ npm install ejson
$ npm install eson
```

## Parser
Expand All @@ -24,7 +24,7 @@ $ npm install ejson
```

With Extended JSON you can define plugin functions, or use ones
bundled with ejson to transform the input, allowing for more
bundled with eson to transform the input, allowing for more
declarative configurations as shown here:

```js
Expand All @@ -49,9 +49,9 @@ function foo(key, val, parser) {
Then use the plugin like so:

```js
var ejson = require('ejson');
var eson = require('eson');

var conf = ejson()
var conf = eson()
.use(foo)
.read('path/to/config.json');
```
Expand All @@ -65,20 +65,20 @@ var conf = ejson()
subsequent plugins may still make modifications. Depending on what the plugins the order used _may_ have an effect on the JSON.

```js
ejson()
.use(ejson.ms)
.use(ejson.include)
.use(ejson.dimensions)
.use(ejson.replace('{root}', '/www/example.com'))
eson()
.use(eson.ms)
.use(eson.include)
.use(eson.dimensions)
.use(eson.replace('{root}', '/www/example.com'))
.parse('{ "interval": "15 minutes" }');
```
### ejson.ms
### eson.ms

The milliseconds plugin supports strings like "5s", "5 seconds", "3 days", etc:

```js
ejson()
.use(ejson.ms)
eson()
.use(eson.ms)
.parse('{ "interval": "15 minutes" }');
```

Expand All @@ -88,14 +88,14 @@ yields:
{ interval: 900000 }
```

### ejson.include
### eson.include

The include plugin allows you to literally include other JSON files. This works in
both arrays and object literals, and loads relative to the callee's file. For example:

```js
ejson()
.use(ejson.include)
eson()
.use(eson.include)
.parse('{ "prod": "include config/production" }');
```

Expand All @@ -105,14 +105,14 @@ yields:
{ prod: { whatever: 'is', within: 'config/production.json' }}
```

### ejson.replace(str, val)
### eson.replace(str, val)

The replace plugin allows you to replace arbitrary substrings, useful
for constants such as the application's root directory etc.

```js
ejson()
.use(ejson.replace('{root}', '/www/example.com'))
eson()
.use(eson.replace('{root}', '/www/example.com'))
.parse('{ "upload path": "{root}/tmp" }');
```

Expand All @@ -122,13 +122,13 @@ yields:
{ "upload path": "/www/example.com/tmp" }
```

### ejson.glob
### eson.glob

The glob plugin allows you to specify glob strings, prefixed by "glob":

```js
ejson()
.use(ejson.glob)
eson()
.use(eson.glob)
.parse('{ "js": "glob public/{js,vendor}/*.js" }');
```

Expand All @@ -146,7 +146,7 @@ yields:
env-specific config into package.json, and package.json remains a
valid JSON document.

For addition documentation view the [test markdown](https://github.com/visionmedia/ejson/blob/master/tests.md).
For addition documentation view the [test markdown](https://github.com/visionmedia/eson/blob/master/tests.md).

## Running tests

Expand Down
10 changes: 5 additions & 5 deletions examples/config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

var Parser = require('../')
, parser = new Parser;
var eson = require('../')
, parser = eson();

console.log();
console.log('Before:');
console.log(parser.read('examples/config.json'));

parser.use(Parser.ms);
parser.use(Parser.dimensions);
parser.use(Parser.replace('{root}', '/www/myapp.com'));
parser.use(eson.ms);
parser.use(eson.dimensions);
parser.use(eson.replace('{root}', '/www/myapp.com'));

console.log();
console.log('After:');
Expand Down
4 changes: 2 additions & 2 deletions examples/glob.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

var Parser = require('../')
var eson = require('../')
, glob = require('glob')
, parser = new Parser;
, parser = eson();

console.log();
console.log('Before:');
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

module.exports = process.env.EJSON_COV
? require('./lib-cov/ejson')
: require('./lib/ejson');
module.exports = process.env.ESON_COV
? require('./lib-cov/eson')
: require('./lib/eson');
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "ejson"
"name": "eson"
, "version": "0.0.1"
, "description": "Extended JSON - pluggable JSON logic for dates, includes, and more"
, "keywords": ["json", "config"]
Expand Down

0 comments on commit 62f9a09

Please sign in to comment.