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 🙏

© 2021 – Pkg Stats / Ryan Hefner

@speleotica/compass

v5.1.1

Published

Compass Cave Survey data I/O

Downloads

82

Readme

@speleotica/compass

CircleCI Coverage Status semantic-release Commitizen friendly npm version

Types and I/O methods for Compass Cave Survey data file formats

Right now this package doesn't contain a parser, just a formatter for output. I'm not going to go to much trouble to document it here unless people ask, the types are pretty self-explanatory:

formatCompassDatFile

import { formatCompassDatFile } from '@speleotica/compass/dat'

It takes a CompassDatFile, and optionally an options hash with a write function. If you don't provide write, it will return the output as a string. Otherwise, it will call write with chunks of data, so you can pass write connected to a file write stream.

formatCompassMakFile

import { formatCompassMakFile } from '@speleotica/compass/mak'

It takes a CompassMakFile, and optionally an options hash with a write function. If you don't provide write, it will return the output as a string. Otherwise, it will call write with chunks of data, so you can pass write connected to a file write stream.

parseCompassMakFile

import { parseCompassMakFile } from '@speleotica/compass/mak'

Takes a SegmentParser and returns the parsed CompassMakFile. Throws if there are any parse errors.

parseCompassDatFile

import { parseCompassDatFile } from '@speleotica/compass/dat'

Signature

async function parseCompassDatFile(
  file: string,
  lines: AsyncIterable<string>
): Promise<CompassDatFile>

Node API

writeCompassDatFile(file: string, data: CompassDatFile): Promise<void>

import { writeCompassDatFile } from '@speleotica/compass/node'

Writes Compass survey data to the given file.

writeCompassMakFile(file: string, data: CompassMakFile): Promise<void>

import { writeCompassMakFile } from '@speleotica/compass/node'

Writes Compass project data to the given file.

parseCompassMakFile(file: string): Promise<CompassMakFile>

import { parseCompassMakFile } from '@speleotica/compass/node'

Parses a Compass project file.

parseCompassDatFile(file: string): Promise<CompassDatFile>

import { parseCompassDatFile } from '@speleotica/compass/node'

Parses a Compass survey file.

parseCompassMakAndDatFiles(file: string, task?: Task): Promise<CompassMakFile>

import { parseCompassMakAndDatFiles } from '@speleotica/compass/node'

Parses a Compass project file, then parses all of the linked survey files in it. All dat file directives in the result will have their data property set to the parsed CompassDatFile data.

The Task interface`

This allows you to receive progress notifications or cancel the parsing.

onProgress(progress: {message?: string, completed?: number, total?: number}): any

The function will call this method with progress updates. Not all fields may be set at the same time.

canceled: boolean

If you set this to true, the function will reject with a canceled Error.