Skip to content

Instantly share code, notes, and snippets.

@ghostdevv
Created March 21, 2022 15:46
Show Gist options
  • Save ghostdevv/a81444ae248329cb53574a23eedbd4b1 to your computer and use it in GitHub Desktop.
Save ghostdevv/a81444ae248329cb53574a23eedbd4b1 to your computer and use it in GitHub Desktop.
Convert any js project to rust in 0.1ms

The following command will change 'use strict' to 'use rust'!

find . -name "*.js" -type f ! -path "*/node_modules/*" -exec sed -i "s/'use strict'/'use rust'/g" {} +

Example

Before we have a slow, legacy js project

'use strict';

function slow() {
  // ...

After the command it's fixed!

'use rust';

fn fast() {
  // ...
@ghostdevv
Copy link
Author

sweet, though this might be legacy by then so keep that in mind

@ghostdevv
Copy link
Author

nvm the CD wasn't fast enough and we got beaten by js2rust4wasm

@braebo
Copy link

braebo commented Mar 21, 2022

throwing-papers-im-done.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment