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

fwrule

v2.1.1

Published

Parser for Joyent firewall rules

Downloads

25

Readme

sdc-fwrule

This repository is part of the Joyent Triton project. See the contribution guidelines and general documentation at the main Triton project page.

This contains shared code for manipulating Triton firewall rules. There are two parts to this package:

  • A Jison grammar (src/fwrule.jison) that specifies a DSL for writing firewall rules. This is used to generate the parser (lib/parser.js)
  • A rule object that wraps the parser and provides various convenience and serialization methods.

The parser is currently checked in to avoid requiring jison to be installed in order to use this package.

After making changes to this repo, repos which depend on it should be updated and tested appropriately:

  • sdc-fwapi should have the fwrule dependency bumped as needed in its package.json. When a new version of the rule language is released, FWRULE_VERSION should be bumped as needed.
  • smartos-live contains a copy in src/fw/tools/fwrule which gets copied into other locations in the repo by the src/fw/tools/bin/rebuild-node-modules script.
  • sdc-firewaller-agent keeps a checked-in copy of fwadm and therefore fwrule in deps/fw which should be kept in sync with fwadm.

Repository

docs/           Documentation (restdown format)
lib/            Source files
node_modules/   node.js dependencies (populate by running "npm install")
src/            Contains the jison grammar for creating the firewall rule
                parser
tools/          Tools and configuration files
test/           Test suite (using nodeunit)

Development

If you update the jison grammar, run the following to regenerate the parser:

make parser

Before checking in, please run:

make check

and fix any warnings. Note that jsstyle will stop after the first file with an error, so you may need to run this multiple times while fixing.

For non-trivial changes, please add a unit test that covers the functionality of the change. If this is a syntax change, update docs/rules.md.in and docs/examples.md.in accordingly.

Testing

To run all tests:

make test

To run an individual test:

./node_modules/.bin/nodeunit <path to test file>