Edits history of script submission #6009 for ' Read a file from S3 within a script (Bun) (s3)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    // Details on S3 integration at https://www.windmill.dev/docs/core_concepts/persistent_storage/large_data_files
    
    import * as wmill from 'windmill-client';
    import { S3Object } from 'windmill-client';
    
    export async function main(input_file: S3Object) {
    	// Load the entire file_content as a Uint8Array
    	const file_content = await wmill.loadS3File(input_file);
    
    	const decoder = new TextDecoder();
    	const file_content_str = decoder.decode(file_content);
    	console.log(file_content_str);
    
    	// Or load the file lazily as a Blob
    	let fileContentBlob = await wmill.loadS3FileStream(input_file);
    	console.log(await fileContentBlob.text());
    }

    Submitted by hugo697 367 days ago

  • bun
    // Details on S3 integration at https://www.windmill.dev/docs/core_concepts/persistent_storage/large_data_files
    
    import * as wmill from 'windmill-client';
    import { S3Object } from 'windmill-client';
    
    export async function main(input_file: S3Object) {
    	// Load the entire file_content as a Uint8Array
    	const file_content = await wmill.loadS3File(input_file);
    
    	const decoder = new TextDecoder();
    	const file_content_str = decoder.decode(file_content);
    	console.log(file_content_str);
    
    	// Or load the file lazily as a Blob
    	let fileContentBlob = await wmill.loadS3FileStream(input_file);
    	console.log(await fileContentBlob.text());
    }

    Submitted by henri186 788 days ago