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 🙏

© 2024 – Pkg Stats / Ryan Hefner

diving-decompression

v1.0.14

Published

Exposes methods for defining/calculating diving decompression schedules/protocols based on the US Navy dive manual revision 7

Downloads

21

Readme

UNDER CONSTRUCTION

DO NOT USE THIS PACKAGE UNTIL STABLE VERSION HAS BEEN RELEASED!!!!!

IMPORTANT NOTE FROM THE AUTHOR

this module is under construction, it is NOT suitable for usage in real dive operations neither commercial nor recreational, as i need to make extensive test and audit the package reliability. it is not only a matter of applying unit testing as this calculations are crucial for divers safety; also regardless of the extensive tests and trials in humans performed by the US Navy along the years with regards of decompression sickness, it has been stated many times by relevant stakeholders that these trials do not necessarily entail 100% accuracy on the results of undertaking a dive operations within the constraints of these dive tables. there is many factors that are not taken into consideration (e.g: water temperature, diver physiological fitness, unaverted PFOs... to name a few).

Sources

the main source for this module is the US Navy Diving Manual, which is the most comprehensive resource for educational and operational reference in the diving industry. you can find a copy of the 7th revision of this manual in this repository

Compatibility

You can install this module in ANY Javascript or Typescript project. it is written in Typescript, targeting ES6 and it was initially designed to be used along Javascript Frontend Frameworks or libraries (eg. React, Angular or Vue), but it can also be used perfectly with Nodejs programs on the server side...

Installation

This module includes its typings inside index.d.ts file, so you dont need to download any other types. this is crucial because the dive tables associated with this module are type checked with the very same interfaces that are being used currently to type check the functions and methods. this becomes very important when calculating dives because it adds an extra layer of security on top of the test cases so we are 100% positive that youre reading the correct table and that it has the appropriate structure, no data extra or missing data ensures youre reading what youre suppose to read in the results.

npm i diving-decompression

Usage

first you need your dive data to be in a configuration object; if you are diving a single dive, you must specify these parameters in the configuration object:

  1. depth : number (depth of the dive expressed in feet of sea water)
  2. bottomTime : number (the time from leaving surface to leaving bottom expressed in minutes)

diving-decompression exposes 3 methods compatible with this configuration object

To find the no-decompression-limit for air dives use:

import { noDecompressionLimit } from 'diving-decompression'
...
const dive = { depth: 123, bottomTime: 15 };
const ndl = noDecompressionLimit(dive);
console.log(ndl)

To find the group letter use:

import { groupLetter } from 'diving-decompression'
...
const dive = { depth: 123, bottomTime: 15 };
const gl = groupLetter(dive);
console.log(gl)

To find the decoObject use:

import { diveDeco } from 'diving-decompression'
...
const dive = { depth: 100, bottomTime: 135 };
const decoObject = diveDeco(dive);
console.log(decoObject)

this method returns an object with the following structure.

{
  minTime: 101, 
  maxTime: 110,
  ttfs: '2:20', // Total time first stop (string)
  airTAT: '520:00', // in water decompression with Air Total Ascent time (string)
  o2TAT: '188:20', // in water decompression with Air/O2 Total Ascent time (string)
  o2cp: 5, // SurDO2 chamber periods required (number)
  repetLetter: 'N/A', // Repetitive Letter (string)
  surDo2Recom: true, // inWater Decompression or SurDO2 recommended (boolean)
  surDo2Req: true, // Exceptional Exposure, SurDO2 Required (boolean)
  strictlySurDo2: true, // Exceptional Exposure, Strictly SurDO2 (boolean)
  exceptionalExposure: true, // Exceptional Exposure, inWater Deco or SurDO2 Required (boolean)
  airDecoStops: [ // in Water decompression with Air Schedule
    { depth: 20, time: 433 }, // all air stops depth and time
    { depth: 30, time: 38 },
    { depth: 40, time: 25 },
    { depth: 50, time: 21 },
  ],
  o2decoStops: [ // in water decompression with Air/O2 Schedule (O2 for the 30' and 20')
    { depth: 20, time: 105 }, // O2 stop
    { depth: 30, time: 19 }, // O2 stop
    { depth: 40, time: 25 }, // air stop
    { depth: 50, time: 21 }, // air stop
  ],
},

the other possible configuration object; if you are diving a repetitive dive, you must specify these parameters in the configuration object:

  1. depth : number (depth of the dive expressed in feet of sea water)
  2. bottomTime : number (the time from leaving surface to leaving bottom expressed in minutes)
  3. sit : number (surface interval time expressed in minutes)
  4. nextDepth : number (next planned depth expressed in feet of sea water)

diving-decompression exposes 2 methods compatible with this configuration object

To find the repetitive dive letter use:

import { repetLetter } from 'diving-decompression'
...
const divePlan = { 
  depth: 123, 
  bottomTime: 15, 
  sit: 123,
  nextDepth: 321,
};
const rl = repetLetter(divePlan);
console.log(rl)

To find the residual nitrogen time use:

import { residualNitrogenTime } from 'diving-decompression'
...
const divePlan = { 
  depth: 123, 
  bottomTime: 123, 
  sit: 123,
  nextDepth: 123,
};
const rnt = residualNitrogenTime(divePlan);
console.log(rnt)

Road Map Specific Objectives

  1. to develop a series of return objects with the specific guidelines that are relevant to the specific dive profile introduced.

  2. to develop a series of graphical charts to represent the decompression profiles.

  3. to develop a series of specific errors and warning objects relevant to the profile introduced.

License

MPL-2.0