1.0.0 • Published 3 years ago

loadfxt v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

CI codecov

loadfxt

Tiny JavaScript library to load fixtures of different formats.
Don't know why this isn't included in every testing framework already 🤷

Examples

  1. Binary data
loadfxt('<path/to/fixture>').toArrayBuffer();
  1. Binary string
    Each byte is represented as one character in the resulting string.
loadfxt('<path/to/fixture>').toBinaryString();
  1. UTF-8 string
    The loaded data will be represented in UTF-8 encoding.
loadfxt('<path/to/fixture>').toUtf8();
  1. JSON
loadfxt('<path/to/fixture>').toJson();