// Also (stringify and pared) GeoJSON as geometry is supported including crs.

stream.end();

JSONTransform

Transform stream for any kind of JSON

TypeScript:

import { JSONTransformStream } from '@yaga/etl';

const stream: JSONTransformStream = new JSONTransformStream({

fn: (data: any) => {

data.test = true;

return data;

}

});

stream.on('data', (chunk: any) => {

console.log(chunk, 'is comparable to', {any: 'data', test: true});

});

stream.write({

any: 'data'

});

stream.end();

JavaScript:

constetl=require('@yaga/etl');

conststream=newetl.JSONTransformStream({

fn:function(data){

data.test=true;

return data;

}

});

stream.on('data',function(chunk){

console.log(chunk,'is comparable to',{any:'data', test:true});

});

stream.write({

any:'data'

});

stream.end();

Known Issues

The package epsg-to-proj has a JSON file as main-entrypoint. That is not supported by TypeScript. A workaround is to
change the main entrypoint in the package.json to "main": "index.js" and create a simple index.js that just
exports and requires the json file.