API Docs for: 0.3.0
Show:

TmpStore Class

Extends Store
Defined in: lib/store/tmp.js:18
Module: store

a Store implementation using temporary files.

Usage

 var store = require('istanbul').Store.create('tmp');

Constructor

TmpStore

(
  • opts
)

Defined in lib/store/tmp.js:18

Parameters:

  • opts Object

    Optional.

    • [tmp] String optional

      a pre-existing directory to use as the tmp directory. When not specified, a random directory is created under os.tmpDir()

Methods

dispose

()

Inherited from Store: lib/store/index.js:95

lifecycle method to dispose temporary resources associated with the store

get

(
  • key
)
String

Inherited from Store: lib/store/index.js:74

returns the content associated to a specific key or throws if the key was not set

Parameters:

  • key String

    the key for which to get the content

Returns:

String:

the content for the specified key

getObject

(
  • key
)
Object

Inherited from Store: lib/store/index.js:100

sugar method to return an object associated with a specific key. Throws if the content set against the key was not a valid JSON string.

Parameters:

  • key String

    the key for which to return the associated object

Returns:

Object:

the object corresponding to the key

hasKey

(
  • key
)

Inherited from Store: lib/store/index.js:88

returns true if the key is one for which a get() call would work.

Parameters:

  • key String

Returns:

true if the key is valid for this store, false otherwise

keys

() Array

Inherited from Store: lib/store/index.js:82

returns a list of all known keys

Returns:

Array:

an array of seen keys

set

(
  • key
  • contents
)

Inherited from Store: lib/store/index.js:64

sets some content associated with a specific key. The manner in which duplicate keys are handled for multiple set() calls with the same key is implementation-specific.

Parameters:

  • key String

    the key for the content

  • contents String

    the contents for the key

setObject

(
  • key
  • object
)

Inherited from Store: lib/store/index.js:110

sugar method to set an object against a specific key.

Parameters:

  • key String

    the key for the object

  • object Object

    the object to be stored