Registry
R

meteor-1-convert-sync-calls-to-async

No description available

roshangeorge970 executions

  • Legacy
Connect a repo
npx codemod meteor-1-convert-sync-calls-to-async

Short description

Detailed description

Example

Before

ts
Meteor.methods({
  a() {
    const doc = MyCollection.findOne({ _id: '12' });
  },
});

After

ts
Meteor.methods({
  async a() {
    const doc = await MyCollection.findOneAsync({ _id: '12' });
  },
});

,

Before

ts
Meteor.methods({
  anotherMethod() {
    const user = Meteor.users.findOne({ username: 'john_doe' });
  },
});

After

ts
Meteor.methods({
  async anotherMethod() {
    const user = await Meteor.users.findOneAsync({ username: 'john_doe' });
  },
});

,

Before

ts
Meteor.methods({
  getUserProfile() {
    const profile = Profiles.findOne({ userId: 'abc123' });
  },
});

After

ts
Meteor.methods({
  async getUserProfile() {
    const profile = await Profiles.findOneAsync({ userId: 'abc123' });
  },
});

Ready to evolve your codebase?

Build tailored, compiler-aware skills to assess, plan, and automate complex codebase changes.