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

brace_option

v0.5.4

Published

This script provides function which sits in a prototype to create prototypal property chaining control.

Downloads

7

Readme

Build status Downloads

| The Bracket Suite | Ubuntu on Windows | |:-----------------------:|:-------------------------:| | Bracket logo | Ubuntu on Windows logo | |

Synopsis


Brace Option help pages


Author: Robert Steckroth, Bust0ut [email protected]

Licensed under: MIT

The primary purpose of this library is to create option like data within a prototype for program operation.

Usage instructions

The library provides a member which returns an Object to be used in a prototype. The returned Object contains a few additional methods which operate on the prototype. Below are the members which are created with the library return Object.

clear([string, ...])

  • The clear member should be called with no parameters or with zero to many string parameters. All of the properties that were added with the original constructor (the option members), and any added with the add_qualifier() member, will have the values reset to the current prototype value. An empty call clears all of the option values while only those properties matching the strings passed in will be reset if parameters are passed in. This member is idempotent.

proto_extend(Object)

  • This will extend the current prototype it is attached to with a complete description of the passed in Object. These properties are not added as option members as this is a convenience member.

extend(Object)

  • This will extend the returned Object with a complete description of the passed in Object. These properties are not added as option members as this is a convenience member.

add_qualifier(qualifer, alias)

  • Adds a property to the current list of option members. This method also accepts a an alias as the second argument which will be cleared whenever the first one is. This is usefull when using getters and setters within the option data. The alias qualifier does not show up in the list() output.

remove_qualifier(qualifer)

  • Remove an entry from the current list of option members. This will also remove any aliased properties from the list.

list()

  • This will return an Object which contains all of the current option qualifers.

Basic example of Brace Option usage:

if (typeof define !== 'function') { var define = require('amdefine')(module) }

define(["brace_option"], function(proto) {

	// usable_one and usable_two are mantained by brace option.
	var p = proto({
		usable_one: "cool",
		usable_two: "joes"

	})

	// The prototype can be extended this way. These are basic prototype members.

	var User = function() { 
	}

	User.prototype = p.extend({
		whats_up: function() { 
			console.log("doc")
		}
	})

	console.log(p.list())
})