Skip to content

Commit

Permalink
Completed README
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Aug 22, 2011
1 parent d0171d8 commit 5e73404
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.mkd
Expand Up @@ -10,28 +10,28 @@ var props = require("props");
// Use JSON

var json =
'{\
"title": "How to use node.js",\
"date": "2011-08-09T17:56:00",\
"tags": [ "example", "node.js" ]\
}\
\
\
Node.js is a new technology...';
'{\n\
"title": "How to use node.js",\n\
"date": "2011-08-09T17:56:00",\n\
"tags": [ "example", "node.js" ]\n\
}\n\
\n\
\n\
Node.js is a new technology...';

console.log(props(json));

// or YAML

var yaml =
'title: How to use node.js\
date: 2011-08-09T17:56:00\
tags:\
- example\
- node.js\
\
\
Node.js is a new technology...';
'title: How to use node.js\n\
date: 2011-08-09T17:56:00\n\
tags:\n\
- example\n\
- node.js\
\n\
\n\
Node.js is a new technology...';

console.log(props(yaml));
```
Expand All @@ -47,9 +47,13 @@ _JSON_:
__content: 'Node.js is a new technology...' }

```

_YAML_:
```javascript

{ title: 'How to use node.js',
date: Tue, 09 Aug 2011 15:56:00 GMT,
tags: [ 'example', 'node.js' ],
__content: 'Node.js is a new technology...' }
```

The difference is that, due to it's JS implementation, the Date is parsed in the
Expand All @@ -58,6 +62,7 @@ YAML version.
The JSON/YAML part has to be **always** seperated from the content by three
newline characters (`\n\n\n` or `\r\n\r\n\r\n`).


License
=======

Expand Down

0 comments on commit 5e73404

Please sign in to comment.