# converter

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

Latest version **0.0.5** (published 2013-12-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install converter
pnpm add converter
yarn add converter
bun add converter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2013-12-26 |
| First published | 2013-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+7 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Brian Woodward |
| Maintainers | doowb, jonschlinkert, hariadi |
| Keywords | data, convert, assemble, xml, json, yaml, plist |

## Links

- npm: https://www.npmjs.com/package/converter
- Repository: https://github.com/assemble/converter
- Issues: https://github.com/assemble/converter/issues
- npm.io page: https://npm.io/package/converter

## Dependencies (6)

- [csv](https://npm.io/package/csv.md) ~0.3.6
- [plist](https://npm.io/package/plist.md) ~0.4.3
- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [xml2js](https://npm.io/package/xml2js.md) ~0.4.0
- [yamljs](https://npm.io/package/yamljs.md) ~0.1.4
- [pretty-data](https://npm.io/package/pretty-data.md) ~0.40.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.5 (latest) — 2013-12-26
- 0.0.4 — 2013-12-24
- 0.0.3 — 2013-12-24

## README

# converter [![NPM version](https://badge.fury.io/js/converter.png)](http://badge.fury.io/js/converter)  [![Build Status](https://github.com/assemble/converter.png)](https://github.com/assemble/converter)

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

## Getting Started
To install the module, run the following in the command line:

```bash
npm i converter --save
```

Use within your application with the following line of JavaScript:

```js
var converter = require('converter');
```

Calling `var convert = converter(options);` gives you a `transform` stream that will take in data and convert it based on the options passed in.

```js

var fs = require('fs');
var converter = require('converter');

// get a file stream reader pointing to the csv file to convert
var reader = fs.createReadStream('path/to/csv/file.csv');

// get a file stream writer pointing to the json file to write to
var writer = fs.createWriteStream('path/to/output/json/file.json');

// setup the options for the data converter
var options = {
	from: 'csv',
	to: 'json'
};

// get a data converter stream using the given options
var convert = converter(options);

// pipe everything to do the conversion
reader.pipe(convert).pipe(writer);

```


## Contributing
Find a bug? Have a feature request? Please [create an Issue](https://github.com/assemble/converter/issues).

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt][], and build the documentation with [grunt-readme](https://github.com/assemble/grunt-readme).

Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!


## Author

**Jon Schlinkert**

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

**Brian Woodward**

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


## Related
+ [helpers](https://github.com/helpers): some great handlebars helpers that we decided not to include in the [handlebars-helpers](https://github.com/assemble/handlebars-helpers) project, most likely because the code footprint was too big or the helper wasn't generic enough.


## License
Copyright (c) 2013 undefined, contributors.
Released under the  license

***

_This file was generated by [grunt-readme](https://github.com/assemble/grunt-readme) on Tuesday, December 24, 2013._

[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
[package.json]: https://npmjs.org/doc/json.html

---
_Source: https://npm.io/package/converter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
