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

closure

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

closure

Google closure-library wrapper for node.js

  • 1.0.1
  • npm
  • Socket score

Version published
Weekly downloads
11K
decreased by-19.85%
Maintainers
0
Weekly downloads
 
Created
Source

node-closure

Closure library wrapper for node.js. Does execute closure scripts in same execution context while (optionally) in distinct global scope, what is a right thing to do.

Enjoy!

Installation

Just copy closure.js, or using npm:

npm install closure

Introduction

To apply closure to global object:

require.('closure').Closure(global);

To create separate instance of closure

var goog = require.('closure').Closure();

By default closure library base.js is expected to be found in ./closure-library/closure/goog/, to override this, say:

var goog = require.('closure').Closure({CLOSURE_BASE_PATH: 'closure/goog/'});

To fetch additional closure dependencies:

goog.loadScript('my_deps.js');

To easily access other namespaces than goog either apply closure to global object or provide own global object, i.e.

var root = {};
require.('closure').Closure(root);
//root.goog is goog namespace
//root.soy is soy namespace

FAQs

Package last updated on 10 Jan 2011

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