Collection of parsers written in JavaScript

Overview

CSS Parser

build status

Introduction

The ParserLib CSS parser is a CSS3 SAX-inspired parser written in JavaScript. It handles standard CSS syntax as well as validation (checking of property names and values) although it is not guaranteed to thoroughly validate all possible CSS properties.

Adding to your project

The CSS parser is built for a number of different JavaScript environments. The most recently released version of the parser can be found in the dist directory when you check out the repository; run npm run build to regenerate them from the latest sources.

Node.js

You can use the CSS parser in a Node.js script via the standard npm package manager as the parserlib package (npm install parserlib):

var parserlib = require("parserlib");

var parser = new parserlib.css.Parser();

Alternatively, you can copy a single file version of the parser from dist/node-parserlib.js to your own project, and use it as follows:

var parserlib = require("./node-parserlib");

Rhino

To use the CSS parser in a Rhino script, copy the file dist/parserlib.js to your project and then include it at the beginning:

load("parserlib.js");

HTML page

To use the CSS parser on an HTML page, you can either include the entire library on your page:

<script src="parserlib.js"></script>

Or include it as its component parts, the ParserLib core and the CSS parser:

<script src="parserlib-core.js"></script>
<script src="parserlib-css.js"></script>

Note that parsing large JavaScript files may cause the browser to become unresponsive. All three of these files are located in the dist directory.

Basic usage

You can create a new instance of the parser by using the following code:

var parser = new parserlib.css.Parser();

The constructor accepts an options object that specifies additional features the parser should use. The available options are:

  • starHack - set to true to treat properties with a leading asterisk as if the asterisk wasn't there. Default is false.
  • underscoreHack - set to true to treat properties with a leading underscore as if the underscore wasn't there. Default is false.
  • ieFilters - set to true to accept IE < 8 style filter properties. Default is false.
  • strict - set to true to disable error recovery and stop on the first syntax error. Default is false.

Here's an example with some options set:

var parser = new parserlib.css.Parser({ starHack: true, underscoreHack: true });

You can then parse a string of CSS code by passing into the parse() method:

parser.parse(someCSSText);

The parse() method throws an error if a non-recoverable syntax error occurs, otherwise it finishes silently. This method does not return a value nor does it build up an abstract syntax tree (AST) for you, it simply parses the CSS text and fires events at important moments along the parse.

Note: The parseStyleSheet() method is provided for compatibility with SAC-based APIs but does the exact same thing as parse().

Understanding syntax units

The CSS parser defines several types that inherit from parserlib.util.SyntaxUnit. These types are designed to give you easy access to all relevant parts of the CSS syntax.

Media Queries

The parserlib.css.MediaFeature type represents a specific media feature in a media query, such as (orientation: portrait) or (color). Essentially, this type of object represents anything enclosed in parentheses in a media query. Object of this type have the following properties:

  • name - the name of the media feature such as "orientation"
  • value - the value of the media feature (may be null)

The parserlib.css.MediaQuery type represents all parts of a media query. Each instance has the following properties:

  • modifier - either "not" or "only"
  • mediaType - the actual media type such as "print"
  • features - an array of parserlib.css.MediaFeature objects

For example, consider the following media query:

only screen and (max-device-width: 768px) and (orientation: portrait)

A corresponding object would have the following values:

  • modifier = "only"
  • mediaType = "screen"
  • features = array of (name="max-device-width", value="768px") and (name="orientation", value="portrait")

Properties

The parserlib.css.PropertyName type represents a property name. Each instance has the following properties:

  • hack - if star or underscore hacks are allowed, either * or _ if present (null if not present or hacks are not allowed)

When star hacks are allowed, the text property becomes the actual property name, so *width has hack equal to * and text equal to "width". If no hacks are allowed, then *width causes a syntax error while _width has hack equal to null and text equal to _width.

The parserlib.css.PropertyValue type represents a property value. Since property values in CSS are complex, this type of object wraps the various parts into a single interface. Each instance has the following properties:

  • parts - array of PropertyValuePart objects

The parts array always has at least one item.

The parserlib.css.PropertyValuePart type represents an individual part of a property value. Each instance has the following properties:

  • type - the type of value part ("unknown", "dimension", "percentage", "integer", "number", "color", "uri", "string", "identifier" or "operator")

A part is considered any atomic piece of a property value not including white space. Consider the following:

font: 1em/1.5em "Times New Roman", Times, serif;

The PropertyName is "font" and the PropertyValue represents everything after the colon. The parts are "1em" (dimension), "/" (operator), "1.5em" (dimension), "Times New Roman" (string), "," (operator), "Times" (identifier), "," (operator), and "serif" (identifier).

Selectors

The parserlib.css.Selector type represents a single selector. Each instance has a parts property, which is an array of parserlib.css.SelectorPart objects, which represent atomic parts of the selector, and parserlib.css.Combinator objects, which represent combinators in the selector. Consider the following selector:

li.selected > a:hover

This selector has three parts: li.selected, >, and a:hover. The first part is a SelectorPart, the second is a Combinator, and the third is a SelectorPart. Each SelectorPart is made up of an optional element name followed by an ID, class, attribute condition, pseudo class, and/or pseudo element.

Each instance of parserlib.css.SelectorPart has an elementName property, which represents the element name as a parserlib.css.SelectorSubPart object or null if there isn't one, and a modifiers property, which is an array of parserlib.css.SelectorSubPart objects. Each SelectorSubPart object represents the smallest individual piece of a selector and has a type property indicating the type of subpart, "elementName", "class", "attribute", "pseudo", "id", "not". If the type is "not", then the args property contains an array of SelectorPart arguments that were passed to not().

Each instance of parserlib.css.Combinator has an additional type property that indicates the type of combinator: "descendant", "child", "sibling", or "adjacent-sibling".

Using events

The CSS parser fires events as it parses text. The events correspond to important parts of the parsing algorithm and are designed to provide developers with all of the information necessary to create lint checkers, ASTs, and other data structures.

For many events, the event object contains additional information. This additional information is most frequently in the form of a parserlib.util.SyntaxUnit object, which has three properties:

  1. text - the string value
  2. line - the line on which this token appeared
  3. col - the column within the line at which this token appeared

The toString() method for these objects is overridden to be the same value as text, so that you can treat the object as a string for comparison and concatenation purposes.

You should assign your event handlers before calling the parse() method.

startstylesheet and endstylesheet events

The startstylesheet event fires just before parsing of the CSS text begins and the endstylesheet event fires just after all of the CSS text has been parsed. There is no additional information provided for these events. Example:

parser.addListener("startstylesheet", function() {
    console.log("Starting to parse stylesheet");
});

parser.addListener("endstylesheet", function() {
    console.log("Finished parsing stylesheet");
});

charset event

The charset event fires when the @charset directive is found in a stylesheet. Since @charset is required to appear first in a stylesheet, any other occurances cause a syntax error. The charset event provides an event object with a property called charset, which contains the name of the character set for the stylesheet. Example:

parser.addListener("charset", function(event) {
    console.log("Character set is " + event.charset);
});

namespace event

The namespace event fires when the @namespace directive is found in a stylesheet. The namespace event provides an event object with two properties: prefix, which is the namespace prefix, and uri, which is the namespace URI. Example:

parser.addListener("namespace", function(event) {
    console.log("Namespace with prefix=" + event.prefix + " and URI=" + event.uri);
});

import event

The import event fires when the @import directive is found in a stylesheet. The import event provides an event object with two properties: uri, which is the URI to import, and media, which is an array of media queries for which this URI applies. The media array contains zero or more parserlib.css.MediaQuery objects. Example:

parser.addListener("import", function(event) {
    console.log("Importing " + event.uri + " for media types [" + event.media + "]");
});

startfontface and endfontface events

The startfontface event fires when @font-face is encountered and the endfontface event fires just after the closing right brace (}) is encountered after @font-face. There is no additional information available on the event object. Example:

parser.addListener("startfontface", function(event) {
    console.log("Starting font face");
});

parser.addListener("endfontface", function(event) {
    console.log("Ending font face");
});

startpage and endpage events

The startpage event fires when @page is encountered and the endpage event fires just after the closing right brace (}) is encountered after @page. The event object has two properties: id, which is the page ID, and pseudo, which is the page pseudo class. Example:

parser.addListener("startpage", function(event) {
    console.log("Starting page with ID=" + event.id + " and pseudo=" + event.pseudo);
});

parser.addListener("endpage", function(event) {
    console.log("Ending page with ID=" + event.id + " and pseudo=" + event.pseudo);
});

startpagemargin and endpagemargin events

The startpagemargin event fires when a page margin directive (such as @top-left) is encountered and the endfontface event fires just after the closing right brace (}) is encountered after the page margin. The event object has a margin property, which contains the actual page margin encountered. Example:

parser.addListener("startpagemargin", function(event) {
    console.log("Starting page margin " + event.margin);
});

parser.addListener("endpagemargin", function(event) {
    console.log("Ending page margin " + event.margin);
});

startmedia and endmedia events

The startmedia event fires when @media is encountered and the endmedia event fires just after the closing right brace (}) is encountered after @media. The event object has one property, media, which is an array of parserlib.css.MediaQuery objects. Example:

parser.addListener("startpagemargin", function(event) {
    console.log("Starting page margin " + event.margin);
});

parser.addListener("endpagemargin", function(event) {
    console.log("Ending page margin " + event.margin);
});

startkeyframes and endkeyframes events

The startkeyframes event fires when @keyframes (or any vendor prefixed version) is encountered and the endkeyframes event fires just after the closing right brace (}) is encountered after @keyframes. The event object has one property, name, which is the name of the animation. Example:

parser.addListener("startkeyframes", function(event) {
    console.log("Starting animation definition " + event.name);
});

parser.addListener("endkeyframes", function(event) {
    console.log("Ending animation definition " + event.name);
});

startrule and endrule events

The startrule event fires just after all selectors on a rule have been parsed and the endrule event fires just after the closing right brace (}) is encountered for the rule. The event object has one additional property, selectors, which is an array of parserlib.css.Selector objects. Example:

parser.addListener("startrule", function(event) {
    console.log("Starting rule with " + event.selectors.length + " selector(s)");

    for (var i = 0, len = event.selectors.length; i < len; i++) {
        var selector = event.selectors[i];

        console.log("  Selector #1 (" + selector.line + "," + selector.col + ")");

        for (var j = 0, count=selector.parts.length; j < count; j++) {
            console.log("    Unit #" + (j + 1));

            if (selector.parts[j] instanceof parserlib.css.SelectorPart) {
                console.log("      Element name: " + selector.parts[j].elementName);

                for (var k = 0; k < selector.parts[j].modifiers.length; k++) {
                    console.log("        Modifier: " + selector.parts[j].modifiers[k]);
                }
            } else {
                console.log("      Combinator: " + selector.parts[j]);
            }
        }
    }
});

parser.addListener("endrule", function(event) {
    console.log("Ending rule with selectors [" + event.selectors + "]");
});

property event

The property event fires whenever a CSS property (name:value) is encountered, which may be inside of a rule, a media block, a page block, etc. The event object has four additional properties: property, which is the name of the property as a parserlib.css.PropertyName object, value, which is an instance of parserlib.css.PropertyValue (both types inherit from parserlib.util.SyntaxUnit), important, which is a Boolean value indicating if the property is flagged with !important, and invalid which is a Boolean value indicating whether the property value failed validation. Example:

parser.addListener("property", function(event) {
    console.log("Property '" + event.property + "' has a value of '" + event.value + "' and " + (event.important ? "is" : "isn't") + " important. (" + event.property.line + "," + event.property.col + ")");
});

error event

The error event fires whenever a recoverable error occurs during parsing. When in strict mode, this event does not fire. The event object contains three additional properties: message, which is the error message, line, which is the line on which the error occurred, and col, which is the column on that line in which the error occurred. Example:

parser.addListener("error", function(event) {
    console.log("Parse error: " + event.message + " (" + event.line + "," + event.col + ")", "error");
});

Error recovery

The CSS parser's goal is to be on-par with error recovery of CSS parsers in browsers. To that end, the following error recovery mechanisms are in place:

  • Properties - a syntactically incorrect property definition will be skipped over completely. For instance, the second property below is dropped:
a:hover {
    color: red;
    font:: Helvetica;   /* dropped! */
    text-decoration: underline;
}
  • Selectors - if there's a syntax error in any selector, the entire rule is skipped over. For instance, the following rule is completely skipped:
a:hover, foo ... bar {
    color: red;
    font: Helvetica;
    text-decoration: underline;
}
  • @ Rules - there are certain @ rules that are only valid in certain contexts. The parser will skip over @charset, @namespace, and @import if they're found anywhere other than the beginning of the input.

  • Unknown @ Rules - any @ rules that isn't recognized is automatically skipped, meaning the entire block after it is not parsed.

Running Tests

You can run the tests via npm test from the repository's root. You may need to run npm install first to install the necessary dependencies.

Comments
  • Lint source code.

    Lint source code.

    Update the version of jshint used by this package, and delint the code to get rid of ==, unused variables, and maps which inherit from Object.prototype (and thus contain spurious keys like hasOwnProperty).

    opened by cscott 16
  • 0.2.5 release timeline

    0.2.5 release timeline

    Hey Nicholas, I was wondering if there was anything else you wanted to land before cutting a new release? I'd like to do new CSSLint release soon, so any new release here would be appreciated :wink:

    opened by nschonni 16
  • MediaQuery.text minor bug

    MediaQuery.text minor bug

    MediaQuery mediaType and features needs to be joined trough "and".

    For example parsing "only screen and (min-width:450px) and (max-width:1950px)", the text output will be "only screen (min-width:450px) and (max-width:1950px)". It is parsed right but the new text string will be invalid if matched with window.matchMedia

    Thank you.

    opened by mirceapiturca 11
  • Add all SVG properties

    Add all SVG properties

    Adds all missing SVG properties. Adds/updates validation for several SVG properties. Adds tests for all added/modified properties.

    Fixes #28 (which was originally opened as stubbornella/csslint#283).

    opened by mattiacci 9
  • Allow multiple background-repeat values

    Allow multiple background-repeat values

    https://github.com/nzakas/parser-lib/commit/1c7eb7b3578ae568e2dc3bae788097661fd1e155 removed the multi-value ability of this property, but I believe it is still valid according to https://developer.mozilla.org/en-US/docs/CSS/background-repeat.

    Was the removal intentional?

    opened by nschonni 7
  • Replace `ant` with an `npm`-based build process

    Replace `ant` with an `npm`-based build process

    Re-organize the files to match standard node/npm conventions, and use the browserify package to create bundles which are completely backward-compatible with the bundles built with the previous process.

    Fixes: #191

    opened by cscott 6
  • Adding support for @viewport

    Adding support for @viewport

    This is for issue #59 - I added basic support for the viewport at-rule, along with tests for it. My editor trims trailing whitespace, which caused a huge diff. You'll want to add ?w=1 to see the actual changes, and I can turn off the trimmer and resubmit if it's a problem.

    opened by jklein 6
  • Add @document and @-moz-document support

    Add @document and @-moz-document support

    Currently they get flagged as an unknown @ directive https://developer.mozilla.org/en-US/docs/CSS/@-moz-document?redirect=no https://developer.mozilla.org/en-US/docs/CSS/@document

    opened by nschonni 6
  • added support for calc wherever <length> is expected

    added support for calc wherever is expected

    According to https://developer.mozilla.org/en-US/docs/CSS/calc

    calc is supported wherever a length property value is supported.

    This adds support for a calc() function, and adds support for the *, +, and - operators to successfully parse out the calc functions.

    Unit tests updated

    opened by fracmak 6
  • Add @-ms-viewport for IE10

    Add @-ms-viewport for IE10

    Test cases taken from the documentation in http://msdn.microsoft.com/en-us/library/ie/hh869615%28v=vs.85%29.aspx Fixes https://github.com/stubbornella/csslint/issues/401


    This currently fails for the case of a viewport nested in a media query http://dev.w3.org/csswg/css-device-adapt/#media-queries I'm throwing this up so maybe someone (ping @jklein) can figure out a good solution.

    opened by nschonni 5
  • Fix media query stringification

    Fix media query stringification

    The MediaQuery.text property leaves out an and token between the media type and the features.
    It also adds an extra trailing space.

    I fixed it, and modified the test cases to report the error.

    opened by SLaks 5
  • overflow-wrap attribute missing 'anywhere' value

    overflow-wrap attribute missing 'anywhere' value

    The overflow-wrap attribute currently allows break-word and normal, but is missing the anywhere value. See https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap

    opened by jimbojw 0
  • Update property values

    Update property values

    • Add space-evenly and potentially others to justify-content (https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content)
    • Add break-word and potentially others to word-break (https://developer.mozilla.org/en-US/docs/Web/CSS/word-break)

    Locations for a fix: https://github.com/CSSLint/parser-lib/blob/master/src/css/Properties.js#L290 and https://github.com/CSSLint/parser-lib/blob/master/src/css/Properties.js#L488

    See CSSLint/csslint#757

    opened by frvge 0
  • Add support for 'fr' units

    Add support for 'fr' units

    This fixes #228 and the associated CSSLint/CSSLint#691.

    Renamed a method, and didn't remove existing dimension "tokens" to keep compatibility. The reduction of parse failures is intentional.

    opened by mattiacci 0
  • Adds a handful of svg props

    Adds a handful of svg props

    opened by jakeleboeuf 0
Releases(v1.1.1)
  • v1.1.1(Jul 28, 2017)

  • v1.1.0(Jul 28, 2017)

    • CSS3: Add turn unit to definition
    • Parser: Support nested media queries
    • support css3 all property. fix #215
    • Update text-decoration (-style, -line, -color) definition
    • Follow CSSUI4 spec for appearance property while allowing more values…
    Source code(tar.gz)
    Source code(zip)
  • v0.2.5(May 7, 2014)

    • Fix flexbox-related property value parsing (Mark Lee)
    • Support simple blocks in functions (Douglas Christopher Wilson)
    • Update package.json config (Nick Schonning)
    • Ignore NPM debug logs (Nick Schonning)
    • Update repo URL for Travis badge (Nick Schonning)
    • Add support for the CSS3 sizing spec (Mark Lee)
    • Parse quoted and unquoted uri @imports. Fixes #108 (Terin Stock)
    • Allow @viewport to be inside of @media (Derk-Jan Hartman)
    • Fix test task (Tunghsiao Liu)
    • Update viewport unit (Tunghsiao Liu)
    • Add support for animation-fill-mode (Michael Stämpfli)
    • Allow underscores in identifiers (Michael Mattiacci)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.4(May 7, 2014)

    • Release 0.2.4 (Nicholas C. Zakas)
    • Version bump (Nicholas C. Zakas)
    • Add touch-action and -ms-touch-action. (TJ VanToll)
    • Update support and tests for unicode-bidi (isolate, isolate-override, plaintext) (Michael Mattiacci)
    • Update README.md (chrisjshull)
    • Add webkit-prefixed properties of Flexbox 2013 (Rob Wu)
    • Add Flexbox 2012 implementation (IE10) (Rob Wu)
    • Update properties for Flexbox 2009 (Rob Wu)
    • Add (final) Flexbox implementation (2013) (Rob Wu)
    • Add @-ms-viewport for IE10 (Nick Schonning)
    • Add "grey" variants for "gray" colors (Nick Schonning)
    • Fix spacing in StringReader.js tests (Nick Schonning)
    • Fix spacing in testrunner.htm (Nick Schonning)
    • Fix spacing in Validation.js tests (Nick Schonning)
    • Fix spacing in TokenStream.js tests (Nick Schonning)
    • Fix spacing in Specificity.js tests (Nick Schonning)
    • Fix spacing in CSSTokensTests.htm (Nick Schonning)
    • Fix spacing in CSSSpecifityTests.htm (Nick Schonning)
    • Fix spacing in TokenStreamBase.js (Nick Schonning)
    • Fix spacing in SyntaxUnit.js (Nick Schonning)
    • Fix spacing in EventTarget.js (Nick Schonning)
    • Fix spacing in ValidationTypes.js (Nick Schonning)
    • Fix spacing in Validation.js (Nick Schonning)
    • Fix spacing in TokenStream.js (Nick Schonning)
    • Fix spacing in Specificity.js (Nick Schonning)
    • Fix spacing in SelectorSubPart.js (Nick Schonning)
    • Fix spacing in SelectorPart.js (Nick Schonning)
    • Fix spacing in Selector.js (Nick Schonning)
    • Fix spacing in PropertyValuePart.js (Nick Schonning)
    • Fix spacing in PropertyValueIterator.js (Nick Schonning)
    • Fix spacing in PropertyValue.js (Nick Schonning)
    • Fix spacing in PropertyName.js (Nick Schonning)
    • Fix spacing in MediaQuery.js (Nick Schonning)
    • Fix spacing in MediaFeature.js (Nick Schonning)
    • Fix spacing in Combinator.js (Nick Schonning)
    • Fix spacing in README (Nick Schonning)
    • Add EditorConfig for spacing (Nick Schonning)
    • Add overflow-wrap property (Nick Schonning)
    • Add css3 values for writing-mode (Yanis Wang)
    • Duplicated percentage checking (infinit89)
    • Add README to npm build (Nick Schonning)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.3(May 7, 2014)

    • Allow @font-face inside of @media (fixes #75) (Nicholas C. Zakas)
    • Merge pull request #74 from bkw/support-vh-vw-vm (Nicholas C. Zakas)
    • support viewport relative units vh, vw and vm (Bernhard K. Weisshuhn)
    • CI tests on Node 0.6+ stable versions (Nick Schonning)
    • Add inherit as value for border-bottom-color (Nick Schonning)
    • Fix display validation test (Nick Schonning)
    • fix spelling. (TooBug)
    • add tests for 'display' (TooBug)
    • add '-webkit-box' and '-webkit-inline-box' (TooBug)
    • Merge pull request #66 from nschonni/patch-1 (Nicholas C. Zakas)
    • GHFM for README code blocks and titles (Nick Schonning)
    • Adding some tests for the viewport start and end events, and fixing two other existing tests that were broken (Jonathan Klein)
    • Adding support for the @viewport rule along with some tests for it (issue #59) (Jonathan Klein)
    • Move docs content to README (Nick Schonning)
    • Test hooks & keyword data for npm (Artur Cistov)
    • Support inherit for border-radius short and long hand (Nick Schonning)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.2(May 7, 2014)

    • Allow pixel ratios in media queries (Nick Schonning)
    • Add none to appearance values (Nick Schonning)
    • Add -moz display properties (Nick Schonning)
    • Trim default gitconfig (Nick Schonning)
    • Remove build folder and exclude it (Nick Schonning)
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(May 7, 2014)

    • Add missing values from CSS3 vertical-align (Nick Schonning)
    • Add white-space vendor prefixed values (Nick Schonning)
    • Add test for underscore hack (Nick Schonning)
    • Add CSS2 system colors (Nick Schonning)
    • Fix readme (Nicholas C. Zakas)
    • Add travis build status to readme (Nicholas C. Zakas)
    • Fixed media query tests (Nicholas C. Zakas)
    • Remove platform restrictions (Schabse Laks)
    • _operator is used for seperating multiple values for a property (ie. box-shadow: 10px 10px 0, 2px 2px 0) as well as for mathematical operators inside functions. Since functions are the only place mathem
    • added support for + operator for calc functions (Merrifield, Jay)
    • added support for calc wherever is expected (Merrifield, Jay)
    • Update tests/css/Parser.js (mirceapiturca)
    • Update src/css/MediaQuery.js (mirceapiturca)
    • Update build/node-parserlib.js (mirceapiturca)
    Source code(tar.gz)
    Source code(zip)
Obsidian-Snippet-collection - A collection of snippet to customize obsidian

This repo is a collection of CSS snippets for Obsidian.md. To install them on PC

Mara 110 Dec 22, 2022
A collection of all the data structures implemented in javascript code

Data structures A collection of all the data structures implemented in javascript code, interview questions & problems ( with solutions ) Contributors

MSK Web development 2 May 1, 2022
Build your own generative art NFT collection with 21 lines of JavaScript

Avatar Collection Build your own Generative Art NFT Collection in 1 minute. Quickstart Just run the following to get started: git clone https://github

rarepress 79 Dec 16, 2022
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Swagger 23.2k Dec 28, 2022
🐢 A collection of awesome browser-side JavaScript libraries, resources and shiny things.

Awesome JavaScript A collection of awesome browser-side JavaScript libraries, resources and shiny things. Awesome JavaScript Package Managers Componen

chencheng (云谦) 29.6k Dec 29, 2022
A concise collection of classes for PHP, Python, JavaScript and Ruby to calculate great circle distance, bearing, and destination from geographic coordinates

GreatCircle A set of three functions, useful in geographical calculations of different sorts. Available for PHP, Python, Javascript and Ruby. Live dem

null 72 Sep 30, 2022
A collection of Javascript scripts running with Alchemy Web3.js, Fetch, or Axios

Alchemy NFT API Javascript Scripts Clone the repo, install dependencies, and try the API out! Clone git clone [email protected]:alchemyplatform/nft-api-j

Alchemy 47 Nov 29, 2022
Giggy is a collection of a few fun jokes related to Coding & Dark Humor - Created using HTML, JavaScript, CSS & Webpack.

Giggy A Collection of some of the best jokes. This is a Web Application with some jokes related to coding & Dark Humor. Created with data from the Jok

Awais Amjed 7 Jul 28, 2022
Collection of utility functions for common JavaScript/TypeScript task

@oysterlee/utils Collection of utility functions for common JavaScript/TypeScript task Features Tree-shakable No dependencies Installation pnpm i @oys

Oyster Lee 3 Apr 4, 2022
This project displays the art collection using the Metropolitan Museum of Art API. For this project we used HTML, CSS, Javascript, Webpack and Jest.

Metropolitan Museum of Art This project displays the art collection using the Metropolitan Museum of Art API. For this project we used HTML, CSS, Java

David Vera Castillo 11 Dec 24, 2022
Awesome collection of useful javascript snippet 💡

useful-js-snippets 유용한 자바스크립트 코드 조각들을 모아 놓았습니다. TOC Reference Snippets usage Get Value Clamp Sleep Group By Collect By Head Tail Flatten Intersection

Haneul Lee 8 Nov 3, 2022
Awesome-book is an online library website where a user can store a collection of books. Different book can be added and removed. Built with JavaScript using Dom

Awesome-book Description Awesome-book is an online library website where a user can store a collection of books. Differents book can be added and remo

tarike bouari 8 Sep 9, 2022
Barcode generation library written in JavaScript that works in both the browser and on Node.js

Introduction JsBarcode is a barcode generator written in JavaScript. It supports multiple barcode formats and works in browsers and with Node.js. It h

Johan Lindell 4.7k Dec 30, 2022
Lovefield is a relational database for web apps. Written in JavaScript, works cross-browser. Provides SQL-like APIs that are fast, safe, and easy to use.

Lovefield Lovefield is a relational database written in pure JavaScript. It provides SQL-like syntax and works cross-browser (currently supporting Chr

Google 6.8k Jan 3, 2023
:zap: Simple and easy to use lightbox script written in pure JavaScript

baguetteBox.js Simple and easy to use lightbox script written in pure JavaScript. Demo page Table of contents Features Installation Importing Usage Cu

Marek Grzybek 2.3k Jan 3, 2023
A robust HTML entity encoder/decoder written in JavaScript.

he he (for “HTML entities”) is a robust HTML entity encoder/decoder written in JavaScript. It supports all standardized named character references as

Mathias Bynens 3.2k Dec 27, 2022
A complete, fully tested and documented data structure library written in pure JavaScript.

Buckets A JavaScript Data Structure Library Buckets is a complete, fully tested and documented data structure library written in pure JavaScript. Incl

Mauricio 1.2k Jan 4, 2023
geotiff.js is a small library to parse TIFF files for visualization or analysis. It is written in pure JavaScript, and is usable in both the browser and node.js applications.

geotiff.js Read (geospatial) metadata and raw array data from a wide variety of different (Geo)TIFF files types. Features Currently available function

geotiff.js 649 Dec 21, 2022
Geokit - is a command-line interface (CLI) tool written in javascript, that contains all the basic functionalities for measurements, conversions and operations of geojson files.

Geokit Geokit is a command-line interface (CLI) tool written in javascript, that contains all the basic functionalities for measurements, conversions

Development Seed 31 Nov 17, 2022