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

fly-js

v0.0.5

Published

A JavaScript utility library focusing on aviation

Downloads

37

Readme

fly-js v0.0.5

A JavaScript utility library focusing on aviation.

Tests

Test can be run eith by:

npm test

; or

mocha test

Continuous Integration

Via Github's Travis. Runs tests (mocha) and linter (jshint)

API Reference

Navigation functions

fly.distanceTo(58.2, 0, 53.3, -1.2, 2);

Returns the distance between the two pairs of decimal latitude and longitude values in nautical miles to two decimal places (last parameter).

fly.trueCourse(53.0, 0, -9.3, 53, 2);

Returns the initial course between the two pairs of decimal latitude and longitude values in degrees to two decimal places (last parameter).

fly.enroute(34.6169641, 118.400009, 66, 100, 2);

Returns a new position given true course and distance from a given point

fly.intersectionPoint(53.583378, -0.34851, 180, 51.150837, -0.177416, 15);

Returns the position the two great circles intersect; using the pair of latitude, longitude and course values as radials

Convertors

Nautical miles

fly.nauticalMilesTo('Kilometres', 100000, 5);

Returns 10000 nautical miles converted to Kilometres rounded to five decimal places.

fly.nauticalMilesTo('Miles', 100000, 5);

Returns 10000 nautical miles converted to Miles rounded to five decimal places.

fly.nauticalMilesTo('Feet', 100000, 5);

Returns 10000 nautical miles converted to Feet rounded to five decimal places.

fly.nauticalMilesTo('Meters', 100000, 5);

Returns 10000 nautical miles converted to Meters rounded to five decimal places.

fly.nauticalMilesTo('Inches', 100000, 5);

Returns 10000 nautical miles converted to Inches rounded to five decimal places.

fly.nauticalMilesTo('Centimeters', 100000, 5);

Returns 10000 nautical miles converted to Centimeters rounded to five decimal places.

Miles

fly.milesTo('Kilometres', 100000, 5);

Returns 10000 miles converted to Kilometres rounded to five decimal places.

fly.milesTo('Nautical Miles', 100000, 5);

Returns 10000 miles converted to Miles rounded to five decimal places.

fly.milesTo('Feet', 100000, 5);

Returns 10000 miles converted to Feet rounded to five decimal places.

fly.milesTo('Meters', 100000, 5);

Returns 10000 miles converted to Meters rounded to five decimal places.

fly.milesTo('Inches', 100000, 5);

Returns 10000 miles converted to Inches rounded to five decimal places.

fly.milesTo('Centimeters', 100000, 5);

Returns 10000 miles converted to Centimeters rounded to five decimal places.

Kilometres

fly.kilometresTo('Miles', 100000, 5);

Returns 10000 kilometres converted to Miles rounded to five decimal places.

fly.kilometresTo('Nautical Miles', 100000, 5);

Returns 10000 kilometres converted to Nautical Miles rounded to five decimal places.

fly.kilometresTo('Feet', 100000, 5);

Returns 10000 kilometres converted to Feet rounded to five decimal places.

fly.kilometresTo('Meters', 100000, 5);

Returns 10000 kilometres converted to Meters rounded to five decimal places.

fly.kilometresTo('Inches', 100000, 5);

Returns 10000 kilometres converted to Inches rounded to five decimal places.

fly.kilometresTo('Centimeters', 100000, 5);

Returns 10000 kilometres converted to Centimeters rounded to five decimal places.

fly.mpsTo('Knots', 233, 2);

Returns 233 miles per hour converted to Knots rounded to two decimal places.

fly.mpsTo('KilometersPerHour', 233);

Returns 233 miles per hour converted to km/h.

Lookups

Beaufort

fly.beaufortLookup(45);

Returns beaufort description of a 45 knot wind e.g. 'Strong Gale'

fly.beaufortLookup(25);

Returns beaufort force index of a 25 knot wind e.g. 6

fly.beaufortLookup(15, 'all');

Returns beaufort force, description and range of a 15

Wind Cardinal Direction

flyjs.CardinalWindDirection(180);

Returns "S" (South) the cardinal direction for a wind at 180 degrees

Wake (ICAO categorisation)

fly.wakeLookup(4500);

Returns the ICAO wake category for an aircraft of 4500kg

Calculators

fly.HeadWindCalculator(25, 180, 215, 2);

Returns head wind component, given wind speed (knots), wind direction and aircraft direction (later pair both measured in degrees). Rounded to 2 decimal places.

fly.CrossWindCalculator(25, 180, 215, 2);

Returns cross wind component, given wind speed (knots), wind direction and aircraft direction (later pair both measured in degrees). Rounded to 2 decimal places.

Wind Triangle

flyjs.calculateCourseAndGroundSpeed(120, 80, 43, 133, 2);

Returns course and ground speed, given trueAirSpeed, heading, windSpeed and windDirection, rounded to 2 decimal places.

flyjs.calculateHeadingAndGroundSpeed(120, 60, 43, 133, 2);

Returns heading and ground speed, given trueAirSpeed, course, windSpeed and windDirection, rounded to 2 decimal places.

flyjs.calculateWindSpeedAndDirection(trueAirSpeed, groundSpeed, course, heading, 2);

Returns wind speed and direction, given trueAirSpeed, groundSpeed, course and heading, rounded to 2 decimal places.

Contributors

One-man-band at the moment. Contact me at twitter on @rayhammond, or, via my blog here http://geeksretreat.wordpress.com if you are interest in getting involved.

License

MIT