web-e57
v1.2.0
Published
Provides capability to convert E57 file into XYZ, LAZ, XML, JSON formats
Downloads
130
Maintainers
Readme
E57 File Conversion for JavaScript
Provides capability to convert E57
file into XYZ
, LAZ
, XML
, JSON
formats.
Usage in node.js application
import { promises as fs } from "fs";
import { parse } from "path";
import { convertE57 } from "web-e57";
async function processE57(filePath) {
const data = await fs.readFile(filePath);
const dataArray = new Uint8Array(data);
const convertedData = convertE57(dataArray, 'XYZ');
// Write converted data to a file on disk
const { dir, name } = parse(filePath);
const outputFilename = `${dir}/${name}.xyz`;
await fs.writeFile(outputFilename, convertedData);
}
Usage in web application
import { convertE57 } from "web-e57";
async function processE57(file) {
const data = await file.arrayBuffer();
const dataArray = new Uint8Array(data);
const convertedData = convertE57(dataArray, 'XYZ');
const blob = new Blob([convertedData]);
// Do something with blob
}