How to use the assemblyscript/cli/asc.createMemoryStream function in assemblyscript

To help you get started, we’ve selected a few assemblyscript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lastmjs / zwitterion / src / languages / assemblyscript.ts View on Github external
return new Promise((resolve) => {
        const stdout: asc.MemoryStream = asc.createMemoryStream();
        const stderr: asc.MemoryStream = asc.createMemoryStream();

        asc.main([
            params.filepath,
            '--binaryFile', 'binary',
            ...params.ascOptions
        ], {
            stdout,
            stderr,
            readFile: (filename: string, baseDir: string) => {
                const filenameWithoutTSExtension: string = filename.replace('.ts', '');
                return fs.readFileSync(filenameWithoutTSExtension).toString();
            },
            writeFile: (filename: string, contents: Readonly) => {
                resolve({
                    binary: contents,
github lastmjs / zwitterion / src / languages / assemblyscript.ts View on Github external
return new Promise((resolve) => {
        const stdout: asc.MemoryStream = asc.createMemoryStream();
        const stderr: asc.MemoryStream = asc.createMemoryStream();

        asc.main([
            params.filepath,
            '--binaryFile', 'binary',
            ...params.ascOptions
        ], {
            stdout,
            stderr,
            readFile: (filename: string, baseDir: string) => {
                const filenameWithoutTSExtension: string = filename.replace('.ts', '');
                return fs.readFileSync(filenameWithoutTSExtension).toString();
            },
            writeFile: (filename: string, contents: Readonly) => {
                resolve({
                    binary: contents,
                    stdout: stdout.toString(),