Socket
Book a DemoInstallSign in
Socket

google-closure-library-bundler

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-closure-library-bundler

Library for generating a Google Closure Library bundle

2.3.0
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Google Closure Library Bundler

Library for generating a Google Closure Library bundle, based on this demo.

Read more about the Google Closure Library here.

Install

npm install google-closure-library-bundler

Usage

  • Create entry.js:
// for example
goog.require('goog.html.sanitizer.HtmlSanitizer.Builder')
goog.require('goog.html.sanitizer.unsafe')
  • Create build.js:
const { bundle } = require('google-closure-library-bundler')
const { join } = require('path')

bundle('./entry.js', {
  path: join(__dirname, 'dist'),
  filename: 'goog.js',
  hashFunction: 'md5' // required for node 17+
}).then(() => {
  console.log('All bundled up!')
})
  • Run build.js to create a bundle in dist/goog.js
  • Include the bundle in your build:
import goog from './dist/goog'

// for example
const htmlSanitizerBuilder = new goog.html.sanitizer.HtmlSanitizer.Builder()

API

bundle(entry, output) => Promise<string>

Keywords

google

FAQs

Package last updated on 02 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.