Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
How to import multiple functions from module into one object in JavaScript?

I want something like this:

import {get, set} as moduleName from 'module-name'

moduleName.get()

The reason is because sometimes methods of different modules can have the same name, and I don't want to import the whole module because of it

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

There is no such thing as:

import {get, set} as moduleName from 'module-name'

You can either do it like this:

import * as moduleName from 'module-name';
moduleName.get();  //all the exported items will be accessible.

Or this:

import {get as moduleNameGet, set as moduleNameSet} from 'module-name';
moduleNameGet();

Please check this out

about 4 years ago · Santiago Gelvez Report

0

You can use below syntax

import * as module from "module-name";
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!