Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 978 Bytes

persist-es5-js.md

File metadata and controls

40 lines (28 loc) · 978 Bytes

API Examples

.persist (ECMAScript 5)

Persist the integrity object on the current working directory

// Assuming you have previously created an integrity object

// Persist it on disk
Integrity.persist(intObj)
  .then(() => console.log('Integrity file saved'))
  .catch(error => console.error(error))

Persist the integrity object on a specific directory (absolute path)

// Assuming you have previously created an integrity object

// Persist it on disk
Integrity.persist(intObj, '/dir/to/persist/the/integrity/object')
  .then(() => console.log('Integrity file saved'))
  .catch(error => console.error(error))

Persist the integrity object on a specific directory (relative path)

// Assuming you have previously created an integrity object

// Persist it on disk
Integrity.persist(intObj, './dir/to/persist/the/integrity/object')
  .then(() => console.log('Integrity file saved'))
  .catch(error => console.error(error))