🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

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

0.1.3
latest
Source
npm
Version published
Weekly downloads
1
-75%
Maintainers
1
Weekly downloads
 
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

browserify

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