Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

closure-util

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

closure-util

Utilities for Closure Library based projects.

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
increased by59.5%
Maintainers
1
Weekly downloads
 
Created
Source

Closure Util

Utilities for working with Closure Library projects.

Currently

See the tests for details about what works. Currently, the package exports a Manager for resolving script dependencies and a Server for providing a development server.

Create a manager for dealing with script dependencies.

var Manager = require('closure-util').Manager;

var manager = new Manager({
  paths: ['path/to/one/lib/**/*.js', 'path/to/another/lib/**/*.js', 'main.js']
});
manager.on('ready', function() {
  var dependencies = manager.getDependencies('main.js');
  // now you've got a list of scripts in dependency order
});

Create a development server providing a script loader and static assets.

var Manager = require('closure-util').Manager;
var Server = require('closure-util').Server;

var manager = new Manager({
  closure: true,
  paths: [
    'path/to/app/src/**/*.js',
    'path/to/app/examples/*.js'
  ]
});
manager.on('error', function(e) {throw e});
manager.on('ready', function() {
  var server = new Server({
    manager: manager,
    root: 'path/to/app', // static resources will be served from here
    loaderPath: '/examples/lib.js' // the script loader will be provided here
    // this assumes the main script can be derived from the query string like:
    // <script src='lib.js?main=example-1.js'></script>
    // this can be customized by providing a getMain method that accepts a
    // request object and returns the path to the main script
  });
  server.start(3000);
});

Development

Setup:

npm install

Run tests:

npm test

Run tests continuously during development:

npm start

Current Status

FAQs

Package last updated on 29 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc