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

fortress

v0.0.1

Published

Fortress is designed for the defense of client side applications.

Downloads

32

Readme

fortress

Fortress is the Docker for front-end applications. It allows you to your code in a controlled and sandboxed environment. This library was originally designed for my bigpipe project which assumes that your front-end is split up in different pagelets or containers and each of these containers run it's own code.

This project has the following ambitious goals:

  • Sandbox your code and it's used JavaScript primitives so other code will not be affected when you extend Array.prototype with new methods. Nor will you be affected by their changes.
  • Other code from getting broken or stopped when an error occurs in side your own client code.
  • Provide a retry and reload of your code when one of these errors occurs.
  • Greater control over memory usage for single page applications as memory is released when the container is destroyed.
  • Prevent mixing of console.* messages as each outputted in their own container.

Installation

While this library can only be used in browser environments, it's downloadable through npm so it can work browserify and other packaging systems. So to get it through npm, simply run:

npm install fortress

For all other use cases, I would advice you to download the index.js from the latest stable tag. But if you are feeling adventures, you can also try the master branch.

Quick start

'use strict';

//
// @TODO write actual documentations instead of this api listing.
// 
var fort = new Fortress({ options });

//
// fort.all returns all created containers.
//
fort.all();

//
// fort.id returns the container based on the id.
//
fort.id(id);

//
// fort.create creates a new container. If code is supplied it will
// automatically start the newly created container. The options allows you
// control how the container is created and which restrictions it should force
// upon the code.
//
// This method returns the created `Container` instance so it can be manually
// controlled for greater control.
//
fort.create('var code = 1', { options });

//
// Start the container based on the id given.
//
fort.start(id);

//
// Stop the container based on the given id.
//
fort.stop(id);

//
// Restart the container. This is the same as stopping and starting your
// container.
//
fort.restart(id);

//
// When you stop a container it merely removes it from DOM. It does not mean it
// has been destroyed completely. If you never want to run this container again,
// kill it.
//
fort.kill(id);

License

This work is released under MIT. Pull request, contributions and bug reports are encouraged.