开发者社区> 镜像站> NPM> reference-count
reference-count
count references to resources and clean up after sweeps
Last updated 6 years ago by camshaft .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install reference-count 
SYNC missed versions from official npm registry.

reference-count

count references to resources and clean up after sweeps

Usage

var Context = require('reference-count');

var context = new Context();

context.on('resource', function(resource) {
  // called anytime there is a new resource counted
});

context.on('garbage', function(resource) {
  // clean up the resource here
});

context.sweep('actor1')
  .count('resource1')
  .count(['resource2', 'resource3'])
  .done();

context.sweep('actor1')
  .count('resource1')
  .count('resource2'])
  .done();

context.destory('actor1');

Current Tags

  • 0.1.2                                ...           latest (6 years ago)

3 Versions

  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)