Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stl-parser

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stl-parser

STL-parser is a transform stream which convert STL-files to newline separated JSON events for each face.

  • 0.11.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

STL Parser

STL-parser is a transform stream which convert STL-files to newline separated JSON events for each face. Check out jsonlines.org for a detailed specification of the jsonl format.

Installation

As a module for your project:

npm install stl-parser

As a command line program:

npm install -g stl-parser

Usage

Command Line Interface

cat test.stl | stl-parser

This emits a jsonl file-stream with header and facet events. The cli flags --ascii and --binary can be used to enforce parsing with the specified file-encoding.

Javascript API

var stlParser = require('stl-parser'),
	stlStream = fs.createReadStream('/path/to/stl/file.stl'),
	outputFile = fs.createWriteStream('/path/to/export/file.jsonl')

stlStream
	.pipe(stlParser())
	.pipe(outputFile)

There is also the possibility to use it buffered and get one javascript object for the whole STL. This should, however, only be used for small files.

var stlParser = require('stl-parser'),
	stl = fs.readFileSync('/path/to/stl/file.stl')

stlParser(stl).on('data', (data) =>
	fs.writeFileSync('/path/to/export/file.json', data)
)

Keywords

FAQs

Package last updated on 22 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc