{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Module Usage","type":"basic","slug":"module-usage","excerpt":"","body":"```js\nvar dna = require('dna2json');\nvar fs = require('fs');\n\n// dna.createParser() returns a duplex stream\n// input = text from your dna file\n// output = SNPs as JSON\n// to write to disk just pipe it to JSONStream then to fs\n\nvar txt = fs.readFileSync('dna.txt');\ndna.parse(txt, function(err, snps) {\n  // snps = the object with your mutations\n});\n```","updates":[],"order":2,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"567354bb22cd7e0d00fad9d5","category":{"sync":{"isSync":false,"url":""},"pages":["5673543422cd7e0d00fad9d1","567354ab8565060d009a8662","567354bb22cd7e0d00fad9d5"],"title":"dna2json","slug":"dna2json","order":2,"from_sync":false,"reference":false,"_id":"5673511f8565060d009a8659","version":"5505855aae827939002fca6e","__v":3,"project":"55058559ae827939002fca6b","createdAt":"2015-12-18T00:19:43.941Z"},"project":"55058559ae827939002fca6b","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5505855aae827939002fca6f","5673511f8565060d009a8659","5673512458c4890d00bb54a5","56736118f65d9c0d002e3cb2"],"_id":"5505855aae827939002fca6e","createdAt":"2015-03-15T13:12:58.366Z","project":"55058559ae827939002fca6b","__v":4,"releaseDate":"2015-03-15T13:12:58.366Z"},"createdAt":"2015-12-18T00:35:07.538Z","githubsync":"","user":"54ee2c053749bf0d00c7653c","__v":1}
```js var dna = require('dna2json'); var fs = require('fs'); // dna.createParser() returns a duplex stream // input = text from your dna file // output = SNPs as JSON // to write to disk just pipe it to JSONStream then to fs var txt = fs.readFileSync('dna.txt'); dna.parse(txt, function(err, snps) { // snps = the object with your mutations }); ```