Skip to content

Instantly share code, notes, and snippets.

@christianklotz
Created March 19, 2019 15:59
Show Gist options
  • Save christianklotz/70cc068a7c304321e7373501c57f24e4 to your computer and use it in GitHub Desktop.
Save christianklotz/70cc068a7c304321e7373501c57f24e4 to your computer and use it in GitHub Desktop.
Load JSON file into Sketch
let readBinaryFile = (filepath) => {
return NSData.alloc().initWithContentsOfFile(filepath);
};
let path = "path/to/file.json"
let data = readBinaryFile(path)
let contents = NSString.alloc().initWithData_encoding(data, NSUTF8StringEncoding)
console.log(JSON.parse(contents))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment