Socket
Socket
Sign inDemoInstall

google-closure-library-bundler

Package Overview
Dependencies
272
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    google-closure-library-bundler

Library for generating a Google Closure Library bundle


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

[2.2.0] - 2023-06-01

  • Transpile to ES5

Readme

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

  1. Create entry.js:
// for example
goog.require('goog.html.sanitizer.HtmlSanitizer.Builder')
goog.require('goog.html.sanitizer.unsafe')
  1. 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!')
})
  1. Run build.js to create a bundle in dist/goog.js
  2. 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

FAQs

Last updated on 01 Jun 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc