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

astrojs

v0.1.3

Published

Generate astrojs module templates with testing server, test suite, and documentation

Downloads

271

Readme

astrojs

astrojs is a project to develop and consolidate javascript libraries for astronomical applications. Similar to the astropy project, astrojs attempts to gather useful libraries under a single namespace, so they may become shared resources to the astronomical community. There are many codes floating around the web, which if they were consolidated in a central location, would be of much greater value.

If you have a javascript resource that you would like to share, please contact Amit Kapadia.

astrojs module

This module provides a scaffold and convenience functions for developing under the javascript astro namespace. It is most useful when developing astrojs libraries using the coffeescript language. A future release will support development for pure javascript. There are four functions available from the command line.

astrojs new [project name]
astrojs class [class name]
astrojs server
astrojs build

installation

The astrojs module is built using NodeJS. Why Node? Node is another flavor of javascript, javascript that runs server side. A Node module may be developed and run in a similar why to any other scripting language, such as python. As this is a javascript initiative, any utilities should be developed in javascript. If Node is not installed, please refer to its documentation and downloads page.

Upon installation of Node a package manager called NPM will be available. The astrojs module is available via the Node Packaged Modules service. To install the astrojs module run

npm install astrojs -g

This will install astrojs globally, and it will function as a command line utility. (It most likely needs to be run using sudo).

creating an astrojs project

To create an astrojs project run

astrojs new [project name]

This will generate the following project files under a directory named by [project name]:

Cakefile
index.js
lib/
package.json
README.md
src/
  |----[project name].coffee
test/
  |----favicon.ico
  |----lib/jasmine-html.js
  |----lib/jasmine.css
  |----lib/jasmine.js
  |----lib/MIT.LICENSE
  |----SpecRunner.html
  |----specs/

generating a new class

Javascript is a prototype-based language. However a class-like structure can be emulated using particular development patterns. Use of this modules means that the developer is adopting a module pattern for library development. Executing

astrojs new [class name]

from within an astrojs project directory will generate template code for a new class and test functions.

starting a local development server

Development always requires testing. When developing an astrojs module, it is encouraged to test all functionality. Frequently a local testing server is needed. Calling

astrojs server

will spin up a local testing server at http://0.0.0.0:8000. This is useful when unit tests require data that must be accessed on the same domain as the script (e.g. ajax requests to json or binary files).

building an astrojs project

This module encourages development to occur in a modular fashion. Often development of libraries can quickly become overwhelming. Good practice encourages codes to be modulated into separate files, however this requires a build step when delivering the final javascript library. Calling

astrojs build

concatenates all files in the src directory, and provides the final project in the lib directory. It is important to specify the dependency order using the key "_dependencyOrder" in package.json.

example

For an example of using this module for development, please refer to the fitsjs library.