npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

jsotdr

v1.0.0

Published

simple OTDR SOR file parser

Downloads

45

Readme

jsOTDR: Simple OTDR SOR file parser for node.js

The SOR ("Standard OTDR Record") data format is used to store OTDR (optical time-domain reflectometer ) fiber data. The format is defined by the Telcordia SR-4731, issue 2 standard. While it is a standard, it is unfortunately not open, in that the specifics of the data format are not openly available. You can buy the standards document from Telcordia for $750 US (as of this writing), but this was beyond my budget. (And likely comes with all sorts of licensing restrictions. I wouldn't know; I have never seen the document!)

There are several freely available OTDR trace readers available for download on the web, but most do not allow exporting the trace curve into, say, a CSV file for further analysis, and only one that I've found that runs natively on Linux (but without source code; although some of these do work in the Wine emulator). There have been requests on various Internet forums asking for information on how to extract the trace data, but I am not aware of anyone providing any answers beyond pointing to the free readers and the Telcordia standard.

Fortunately the data format is not particularly hard to decipher. The table of contents on the Telcordia SR-4731, issue 2 page provides several clues, as does the Wikipedia page on optical time-domain reflectometer.

Using a binary-file editor/viewer and comparing the outputs from some free OTDR SOR file readers, I was able to piece together most of the encoding in the SOR data format and written a simple program (in Ruby) that parses the SOR file and dumps the trace data into a file. (For a more detailed description, other than reading the source code, see my blog post).

Presented here for your entertainment are my findings, in the hope that it will be useful to other people. But be aware that the information provided here is based on guess work from looking at a limited number of sample files. I can not guarantee that there are no mistakes, or that I have uncovered all possible exceptions to the rules that I have deduced from the sample files. use it at your own risk! You have been warned!

The program was ported over from my original Perl and Python versions (pubOTDR and pyOTDR). There are also versions for Ruby rbOTDR and Clojure cljotdr for those who are interested.

This program requires a few node modules (listed in the package.json file): run

npm install

from the top level directory to install these modules. Run

npm test

to run the tests. This requires the (mocha)[https://github.com/mochajs/mocha] package, but it is required only for unit testing; it is not needed for running the jsOTDR module itself.

An example of how to use the module is shown in jsOTDR/lib/test_drive.js (there is another version called jsOTDR/lib/test_drive_with_winston.js that uses winston for logging, but it is optional). To parse an SOR file, run

./lib/test_drive.js myfile.sor

where "myfile.sor" is the name (path) to your SOR file. A OTDR trace file "myfile-trace.dat" and a JSON file "myfile-dump.json" will be produced.

(Last Revised 2018-01-04)