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

test262-stream

v1.4.0

Published

A Node.js API for traversing the Test262 test suite

Downloads

9,604

Readme

Test262-Stream

A Node.js API for traversing the Test262 test suite.

Usage

var TestStream = require('test262-stream');
var stream = new TestStream('/path/to/test262', {
    // Directory from which to load "includes" files (defaults to the
    // appropriate subdirectory of the provided `test262Dir`
    // Optional. Defaults to './harness'
    includesDir: '/path/to/includes/dir',

    // File system paths refining the set of tests that should be produced;
    // only tests whose source file matches one of these values (in the case of
    // file paths) or is contained by one of these paths (in the case of
    // directory paths) will be created; all paths are interpreted relative to
    // the root of the provided `test262Dir`
    // Optional. Defaults to ['test']
    paths: ['test/built-ins/eval', 'test/language/statements/empty/S12.3_A1.js'],

    // Flag to disable the insertion of code necessary to execute the test
    // (e.g. assertion functions and "include" files); defaults to `false`
    omitRuntime: true,

    // By default, this stream will emit an error if the provided version of
    // Test262 is not supported; this behavior may be disabled by providing a
    // value of the expected version. Use of this option may cause the stream
    // to emit invalid tests; consider updating the library instead.
    acceptVersion: '2.0.0'
  });

stream.on('data', function(test) {
    // the path to the file from which the test was derived, relative to the
    // provided Test262 directory
    console.log(test.file);

    // the complete source text for the test; this contains any "includes"
    // files specified in the frontmatter, "prelude" content if specified (see
    // below), and any "scenario" transformations
    console.log(test.contents);

    // an object representation of the metadata declared in the test's
    // "frontmatter" section
    console.log(test.attrs);

    // the licensing information included within the test (if any)
    console.log(test.copyright);

    // name describing how the source file was interpreted to create the test
    console.log(test.scenario);

    // numeric offset within the `contents` string at which one or more
    // statements may be inserted without necessarily invalidating the test
    console.log(test.insertionIndex);
  });

stream.on('end', function() {
    console.log('No further tests.');
  });

stream.on('error', function(err) {
    console.error('Something went wrong:', err);
  });

License

Copyright 2017, Bocoup LLC under the 3-Clause BSD License (see LICENSE.txt)