Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 992 Bytes

readme.md

File metadata and controls

27 lines (17 loc) · 992 Bytes

dat-key-as Travis npm

Get a dat key as a string or buffer.

  • valid string/buffer: Returns a dat key as a string/buffer
  • invalid key: Throws error
  • null: Returns null

Checks if keys are valid via dat-encoding. Uses dat-string-key and dat-buffer-key to get the key as the right type.

API

Get your key as a string or buffer. Throws error if the key is not valid.

var datKeyAs = require('dat-key-as')

datKeyAs.string(key) // get a key as a string
datKeyAs.buffer(key) // get a key as a buffer

datKeyAs.str(key) // get a key as a string
datKeyAs.buf(key) // get a key as a buffer

License

MIT