open-index/open-npm huggingface dataset:
npm package: @ramumb/class
Description: A port of PrototypeJS's class-based OOP system.
Author: Reginald Mullin
Latest version: 0.0.2

Class(function)
========================================

[![Build Status](https://travis-ci.org/ramumb/class.svg?branch=master)](https://travis-ci.org/ramumb/class)
[![Coverage Status](https://coveralls.io/repos/github/ramumb/class/badge.svg?branch=master)](https://coveralls.io/github/ramumb/class?branch=master)

This is a port of the [PrototypeJS](http://prototypejs.org/) class-based OOP system.

Class([superclass][, methods...]) -> Class
  - superclass (Class): The optional superclass to inherit methods from.
  - methods (Object): An object whose properties will be "mixed-in" to the
    new class. Any number of mixins can be added; later mixins take precedence.

[[Class]] creates a class and returns a constructor function for
instances of the class. Calling the constructor function (typically as
part of a `new` statement) will invoke the class's `initialize` method.

[[Class]] accepts two kinds of arguments. If the first argument is a [[Class]],
it's used as the new class's superclass, and all its methods are inherited.
Otherwise, any arguments passed are treated as objects, and their methods are
copied over ("mixed in") as instance methods of the new class. In cases of
method name overlap, later arguments take precedence over earlier arguments.

If a subclass overrides an instance method declared in a superclass, the
subclass's method can still access the original method. To do so, declare
the subclass's method as normal, but insert `$super` as the first argument.
This makes `$super` available as a method for use within the function.

To extend a class after it has been defined, use [[Class#extend]].

## Browser Support

  * Microsoft Internet Explorer for Windows, version 6.0 and higher
  * Mozilla Firefox 1.5 and higher
  * Apple Safari 2.0.4 and higher
  * Opera 9.25 and higher
  * Chrome 1.0 and higher

## Installation

  `npm install @ramumb/class`

## Usage

    var Class = require('class');

    // properties are directly passed to `create` method
    var Person = new Class({
      initialize: function(name) {
        this.name = name;
      },
      say: function(message) {
        return this.name + ': ' + message;
      }
    });
        
    // when subclassing, specify the class you want to inherit from
    var Pirate = new Class(Person, {
      // redefine the speak method
      say: function($super, message) {
        return $super(message) + ', yarr!';
      }
    });
        
    var john = new Pirate('Long John');
    john.say('ahoy matey');
    // -> "Long John: ahoy matey, yarr!"

## Tests

  `npm test`

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality. Lint and test your
code.  See the [CONTRIBUTING](CONTRIBUTING.md) file for more detailed information.
npm package: @ramumb/object-to-query-string
Description: Turns an object into its URL-encoded query string representation.
Author: Reginald Mullin
Latest version: 0.1.2

object-to-query-string(object)
========================================

[![Build Status](https://travis-ci.org/ramumb/object-to-query-string.svg?branch=master)](https://travis-ci.org/ramumb/object-to-query-string)
[![Coverage Status](https://coveralls.io/repos/github/ramumb/object-to-query-string/badge.svg?branch=master)](https://coveralls.io/github/ramumb/object-to-query-string?branch=master)

This is a port of the [PrototypeJS](http://prototypejs.org/) method
`toQueryString`. It turns an object into its URL-encoded query string
representation.  There's an inverse of this method called `toQueryParams` that's
available at [string-to-query-params](https://github.com/ramumb/string-to-query-params).

`object-to-query-string` is a form of serialization, and is mostly useful to
provide complex parameter sets for stuff such as objects related to Ajax.

Undefined-value pairs will be serialized as if empty-valued. Array-valued pairs
will get serialized with one name/value pair per array element. All values get
URI-encoded using JavaScript's native `encodeURIComponent` function.

The order of pairs in the serialized form is not guaranteed (and mostly
irrelevant anyway) — except for array-based parts, which are serialized in
array order.

Note that undefined will be returned for any non- object parameter.

## Installation

  `npm install @ramumb/object-to-query-string`

## Usage

    var toQueryString = require("object-to-query-string");

    toQueryString({section: 'blog', id: '45'});
    // -> 'section=blog&id=45'
    
    toQueryString({section: 'blog', tag: ['javascript', 'prototype', 'doc']});
    // -> 'section=blog&tag=javascript&tag=prototype&tag=doc'
    
    toQueryString({tag: 'ruby on rails'});
    // -> 'tag=ruby+on+rails'
    
    toQueryString({id: '45', raw: undefined});
    // -> 'id=45&raw'

## Tests

  `npm test`

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality. Lint and test your
code.  See the [CONTRIBUTING](CONTRIBUTING.md) file for more detailed information.
npm package: @ramumb/strip-tags
Description: Strips a string of any HTML tags.
Author: Reginald Mullin
Latest version: 0.1.3

strip-tags(function)
========================================

[![Build Status](https://travis-ci.org/ramumb/strip-tags.svg?branch=master)](https://travis-ci.org/ramumb/strip-tags)
[![Coverage Status](https://coveralls.io/repos/github/ramumb/strip-tags/badge.svg?branch=master)](https://coveralls.io/github/ramumb/strip-tags?branch=master)

This is a port of the [PrototypeJS](http://prototypejs.org/) method `stripTags`.
It strips a string of any HTML 4.01 tags &mdash; like `div`, `span`, and `abbr`.
It _will not_, however, strip namespace-prefixed tags such as `h:table` or
`xsl:template`.  _Nor_ will it remove any content from within `<script>` tags.
Lastly, while `stripTags` is good enough for most purposes, it shouldn't be
relied upon for security purposes. If processing end-user supplied content,
`stripTags` is _not_ sufficiently robust enough to ensure that the content is
completely devoid of HTML tags in the case of an end-user who's intentionally
trying to circumvent a tag restriction.

## Installation

  `npm install @ramumb/strip-tags`

## Usage

    var stripTags = require('strip-tags');

    stripTags('a <a href="#">link</a>');
    // -> 'a link'
    
    stripTags('a <a href="#">link</a><script>alert("hello world!");</script>');
    // -> 'a linkalert("hello world!");'
    
    stripTags('<xsl:template match="/"><html><body><h2>My CD Collection</h2><xsl:apply-templates/></body></html></xsl:template>');
    // -> '<xsl:template match="/">My CD Collection<xsl:apply-templates/></xsl:template>'

## Tests

  `npm test`

## Contributing

In lieu of a formal style guide, take care to maintain the existing coding
style. Add unit tests for any new or changed functionality. Lint and test your
code.  See the [CONTRIBUTING](CONTRIBUTING.md) file for more detailed information.