[oden] IO: Load Strings
It's useful. The stock JS way is bad.
This commit is contained in:
parent
89045ccbcc
commit
17c701a7d6
4 changed files with 42 additions and 3 deletions
12
src/io.ts
12
src/io.ts
|
|
@ -6,6 +6,12 @@ import * as core from "io-core";
|
|||
* @param path The path of the file to load.
|
||||
* @returns The contents of the file.
|
||||
*/
|
||||
export function load(path: string): Promise<ArrayBuffer> {
|
||||
return core.load(path);
|
||||
}
|
||||
export const load = core.load;
|
||||
|
||||
/**
|
||||
* Load the specified file into memory as a string.
|
||||
*
|
||||
* @param path The path of the file to load.
|
||||
* @returns The contents of the file decoded from utf-8.
|
||||
*/
|
||||
export const load_string = core.load_string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue