Socket
Socket
Sign inDemoInstall

browser-module-cache

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-module-cache

Caches browserify-cdn modules using level.js


Version published
Maintainers
1
Created
Source

browser-module-cache

Caches browserify-cdn modules using level.js

npm install browser-module-cache

usage

var createCache = require('browser-module-cache')

initialize

createCache(options)

var cache = createCache({
  name: 'browser-module-cache' // name of level.js database
  inMemory: false // Whether to force usage of memdown
})

put

cache.put(packages, callback)

Saves a browserify-cdn object where the keys bundle and package are required.

cache.put({
  blah: {
    bundle: 'blahblahblah',
    package: {
      name: 'blah',
      author: 'The Dude',
    },
  },
}, function() {
  console.log('saved!')
})

get

cache.get([package, ]callback)

Gets all or one specific package from cache.

cache.get(function(err, modules) {
  console.log('all modules', modules)
})

cache.get('blah', function(err, module) {
  console.log('the blah module', module)
})

clear

cache.clear(callback)

Removes all cached modules.

cache.clear(function(err) {
  console.log('all clean')
})

release history

  • 0.1.3 - Add inMemory option to memdown (@maxogden)
  • 0.1.2 - fallsback to memdown if indexedDB not found
  • 0.1.1 - return empty object if none found during get
  • 0.1.0 - initial release

license

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.

Keywords

FAQs

Package last updated on 11 Mar 2014

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