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

niagara-station

v0.1.12

Published

Start and stop Niagara stations in node

Downloads

1,029

Readme

niagara-station

A node wrapper around a Niagara station process.

Example

// These are the defaults, result is the same as just passing {}
var config = {
  cwd: 'd:\\niagara\\r40\\niagara_home\\bin',
  command: 'station',
  stationName: 'node',
  startedString: 'niagara>',
  log: function (msg, logLevel, pkg) {
    //you can optionally specify your own handler for console output.
    if (pkg === 'web.jetty') {
      console.log('Jetty did something.');
    }
    
    if (logLevel === 'SEVERE') {
      console.error('oh no! ' + msg);
    } else {
      console.log(msg);
    }
  }
};

require('niagara-station')(config, function (err, station) {
  if (err) {
    return;
  }
  
  console.log('station started.');
  
  // Do things with station...
  
  station.quit(function () {
    console.log('station quit.');
  });
});
config.cwd

Type: string Default value: 'NIAGARA_HOME/bin'

Directory where station.exe lives.

config.stationsDir

Type: string Default value: 'NIAGARA_USER_HOME/stations'

Directory where station files live.

config.command

Type: string Default value: 'station'

Command to execute.

config.stationName

Type: string Default value: 'node'

Name of station to start.

config.forceCopy

Type: boolean Default value: false

Set to true if you want to force copying a station folder to NIAGARA_HOME before starting the station (for starting up a fresh station during unit tests, for example).

config.sourceStationFolder

Type: string Default value: undefined

Required if forceCopy is true. The location of the station to copy.

config.startedString

Type: string Default value: 'niagara>'

The string the station will emit to indicate it has finished startup.

config.logLevel

Type: string Default value: 'WARNING'

The logging level to capture from the station and output to the log. Available values are NONE, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, and ALL. Note that ALL is required to capture messages without a logging level (direct System.out.println() calls, for instance).

config.log(string msg, string [level], string [pkg])

| Name | Type | Description | |---------|--------|------------------------------------------------| | msg | string | Message. | | [level] | string | Log level, e.g. WARNING or INFO. Will be undefined if no log level specified. | | [pkg] | string | Package originating the log message, e.g. web.jetty. Will be undefined if no package specified. |

Optional callback to handle console output from the station. If omitted, a default handler will be used that simply logs the station output directly to the console.

config.jvmArgs

Type: Array Default value: []

An array of additional JVM arguments to pass to station.exe. For example: jvmArgs: [ '-Xmx1024m' ]

config.systemProperties

Type: Object Default value: {}

A mapping of system property names to values, to pass to station.exe. For example: systemProperties: { 'niagara.lang': 'en' }