Skip to content

Instantly share code, notes, and snippets.

@mCzolko
Last active September 7, 2022 23:32
Show Gist options
  • Select an option

  • Save mCzolko/81652a0be36286f46f526f4baf8243b9 to your computer and use it in GitHub Desktop.

Select an option

Save mCzolko/81652a0be36286f46f526f4baf8243b9 to your computer and use it in GitHub Desktop.
Maximum operational depth - Command line app
#!/bin/node
const calculate = (arg) => {
const o2percentage = Number(arg)
const fO2 = o2percentage / 100
const mod = (ppO2) => (((ppO2 / fO2) - 1) * 10).toFixed(2)
console.log(`EAN${o2percentage} MOD on ppO2:`)
console.log(` [1.4] ${mod(1.4)}m`)
console.log(` [1.6] ${mod(1.6)}m (deco gas)`)
if (process.argv.indexOf(arg) != process.argv.length - 1) {
console.log('')
}
}
const [ runner, command, ...o2percentages ] = process.argv
o2percentages.forEach(calculate)
@mCzolko
Copy link
Author

mCzolko commented Sep 7, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment