Skip to content

Commit

Permalink
Merge pull request #32 from hariadi/master
Browse files Browse the repository at this point in the history
v0.1.11
  • Loading branch information
hariadi committed May 4, 2014
2 parents 9ff88b1 + 2b9903a commit c2d1887
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 132 deletions.
34 changes: 34 additions & 0 deletions .verbrc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# {%= name %} {%= badge('fury') %} {% if (travis) { %} {%= badge('travis') %}{% } %}

> {%= description %}
## Getting Started
{%= docs("getting-started") %}

## Options

{%= docs("options") %}

## Usage Examples

{%= docs("examples-csv") %}
{%= docs("examples-json") %}
{%= docs("examples-xml") %}
{%= docs("examples-plist") %}

## Contributing

We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involved please see the [Contributing to {%= name %}](http://assemble.io/contributing/) guide for information on contributing to this project.

## Changes
{%= changelog() %}

## Author
{%= contrib("jon") %}
{%= contrib("hariadi") %}

## License
{%= copyright() %}
{%= license() %}

{%= include('footer.md') %}
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
v0.1.11:
date: 2014-05-03
changes:
- Fix (empty string), xml2js (only invoke parseString callback once)
- XML parser error display a warning and abort Grunt immediately

v0.1.10:
date: 2014-03-11
changes:
- Fixing options.type issue and adding more tests around it

v0.1.9:
date: 2013-12-14
changes:
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module.exports = function(grunt) {
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-readme');
grunt.loadNpmTasks('grunt-verb');

// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
Expand All @@ -159,7 +159,7 @@ module.exports = function(grunt) {
grunt.registerTask('test', ['jshint', 'convert']);

// By default, lint and run all tests.
grunt.registerTask('default', ['clean', 'test', 'readme']);
grunt.registerTask('default', ['clean', 'test', 'verb']);


};
135 changes: 66 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# grunt-convert [![NPM version](https://badge.fury.io/js/grunt-convert.png)](http://badge.fury.io/js/grunt-convert) [![Build Status](https://travis-ci.org/assemble/grunt-convert.png)](https://travis-ci.org/assemble/grunt-convert)
# grunt-convert [![NPM version](https://badge.fury.io/js/grunt-convert.png)](http://badge.fury.io/js/grunt-convert) [![Build Status](https://travis-ci.org/assemble/grunt-convert.png)](https://travis-ci.org/assemble/grunt-convert)

> Convert between XML, JSON and YAML, from one format to another.
## Getting Started

_If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide._

From the same directory as your project's [Gruntfile][Getting Started] and [package.json][], install this plugin with the following command:
Expand All @@ -24,7 +23,6 @@ If the plugin has been installed correctly, running `grunt --help` at the comman
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html


## Options

###### type
Expand Down Expand Up @@ -67,7 +65,6 @@ List of fields or true if autodiscovered in the first CSV line.

See [node-csv](https://github.com/wdavidw/node-csv/blob/master/doc/from.md#from.options) for other available options.


## Usage Examples


Expand All @@ -88,7 +85,6 @@ grunt.initConfig({
```



### Convert JSON to XML

```js
Expand Down Expand Up @@ -131,6 +127,44 @@ grunt.initConfig({
});
```

### Convert XML to YAML

```js
grunt.initConfig({
convert: {
options: {
explicitArray: false,
},
xml2yml: {
src: ['convert.xml'],
dest: 'dist/convert.yml'
}
}
});
```

### Convert XML to JSON

```js
grunt.initConfig({
convert: {
options: {
explicitArray: false,
},
xml2json: {
files: [
{
expand: true,
cwd: 'test/fixtures/',
src: ['**/*.xml'],
dest: 'tmp/result/',
ext: '.json'
}
]
},
}
});
```

### Convert PLIST to JSON

Expand Down Expand Up @@ -173,78 +207,41 @@ grunt.initConfig({
```



### Convert XML to YAML

```js
grunt.initConfig({
convert: {
options: {
explicitArray: false,
},
xml2yml: {
src: ['convert.xml'],
dest: 'dist/convert.yml'
}
}
});
```

### Convert XML to JSON

```js
grunt.initConfig({
convert: {
options: {
explicitArray: false,
},
xml2json: {
files: [
{
expand: true,
cwd: 'test/fixtures/',
src: ['**/*.xml'],
dest: 'tmp/result/',
ext: '.json'
}
]
},
}
});
```


## Contributing

Please see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project.

## Authors
We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involved please see the [Contributing to grunt-convert](http://assemble.io/contributing/) guide for information on contributing to this project.

## Changes
**DATE** **VERSION** **CHANGES**
* 2014-05-03 v0.1.11 Fix (empty string), xml2js (only invoke parseString callback once),XML
parser error display a warning and abort Grunt immediately
* 2014-03-11 v0.1.10 Fixing options.type issue and adding more tests around it
* 2013-12-14 v0.1.9 Fix json to yml converter,Add `type` option to define content with unknown
extension
* 2013-12-18 v0.1.8 adding missing write file statement when converting xml to json
* 2013-12-12 v0.1.7 Fix async issues
* 2013-12-02 v0.1.6 Add support for Grunt 0.4.2,Use external library,Fix missing "Release
History"
* 2013-09-10 v0.1.5 Add support for JSON to CSV.
* 2013-09-10 v0.1.4 Add support for CSV to JSON.
* 2013-07-16 v0.1.3 JSON/YAML to XML.
* 2013-07-15 v0.1.2 Add support YAML. Added XML to JSON/YAML, JSON to YAML, and YAML to JSON.
* 2013-07-02 v0.1.1 XML to JSON.

## Author

**Jon Schlinkert**

+ [http://twitter.com/jonschlinkert](http://twitter.com/jonschlinkert)
+ [http://github.com/jonschlinkert](http://github.com/jonschlinkert)
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

**Hariadi Hinta**

+ [http://twitter.com/hariadi](http://twitter.com/hariadi)
+ [http://github.com/hariadi](http://github.com/hariadi)

## Release History

* 2013-12-14   v0.1.9   Fix json to yml converter Add `type` option to define content with unknown extension
* 2013-12-18   v0.1.8   adding missing write file statement when converting xml to json
* 2013-12-12   v0.1.7   Fix async issues
* 2013-12-02   v0.1.6   Add support for Grunt 0.4.2 Use external library Fix missing "Release History"
* 2013-09-10   v0.1.5   Add support for JSON to CSV.
* 2013-09-10   v0.1.4   Add support for CSV to JSON.
* 2013-07-16   v0.1.3   JSON/YAML to XML.
* 2013-07-15   v0.1.2   Add support YAML. Added XML to JSON/YAML, JSON to YAML, and YAML to JSON.
* 2013-07-02   v0.1.1   XML to JSON.
+ [github.com/assemble](https://github.com/assemble)
+ [twitter.com/assemble](http://twitter.com/assemble)

## License
[MIT License](LICENSE-MIT)

***
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license

_This file was generated by [grunt-readme](https://github.com/assemble/grunt-readme) on Tuesday, March 11, 2014._
_This file was generated by [grunt-verb](https://github.com/assemble/grunt-verb) on May 04, 2014._
55 changes: 0 additions & 55 deletions docs/README.tmpl.md

This file was deleted.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-convert",
"description": "Convert between XML, JSON and YAML, from one format to another.",
"version": "0.1.10",
"version": "0.1.11",
"homepage": "https://github.com/assemble/grunt-convert",
"author": {
"name": "Jon Schlinkert",
Expand All @@ -28,18 +28,18 @@
"test": "grunt test"
},
"dependencies": {
"yamljs": "~0.1.4",
"yamljs": "~0.1.5",
"pretty-data": "~0.40.0",
"csv": "~0.3.7",
"plist": "~0.4.3",
"xml2js": "~0.4.1",
"xml2js": "~0.4.2",
"async": "~0.2.10"
},
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-jshint": "~0.8.0",
"grunt": "~0.4.4",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-readme": "~0.4.5"
"grunt-verb": "~0.2.2"
},
"keywords": [
"convert json",
Expand Down

0 comments on commit c2d1887

Please sign in to comment.