is it possible to destrucure my import statements2019 Community Moderator ElectionIs it possible to do multiple class imports with ES6/Babel?Is it possible to add dynamically named properties to JavaScript object?Use of .apply() with 'new' operator. Is this possible?How to apply !important using .css()?How to check if an object is an array?Using node.js as a simple web serverIs it possible to apply CSS to half of a character?Using Node.js require vs. ES6 import/exportES6: Conditional & Dynamic Import StatementsWhen should I use curly braces for ES6 import?Node.js - SyntaxError: Unexpected token import

An Undercover Army

Create chunks from an array

What is the meaning of "notice to quit at once" and "Lotty points”

Misplaced tyre lever - alternatives?

Can I solder 12/2 Romex to extend wire 5 ft?

Find maximum of the output from reduce

Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?

How do we objectively assess if a dialogue sounds unnatural or cringy?

Should we avoid writing fiction about historical events without extensive research?

function only contains jump discontinuity but is not piecewise continuous

Why do phishing e-mails use faked e-mail addresses instead of the real one?

The need of reserving one's ability in job interviews

What is the difference between 主菜 and 主食?

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Is there a way to find out the age of climbing ropes?

Did Amazon pay $0 in taxes last year?

Is every open circuit a capacitor?

Plagiarism of code by other PhD student

Why is it "take a leak?"

Can we carry rice to Japan?

How can I conditionally format my HTML table?

Relationship between the symmetry number of a molecule as used in rotational spectroscopy and point group

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

How does signal strength relate to bandwidth?



is it possible to destrucure my import statements



2019 Community Moderator ElectionIs it possible to do multiple class imports with ES6/Babel?Is it possible to add dynamically named properties to JavaScript object?Use of .apply() with 'new' operator. Is this possible?How to apply !important using .css()?How to check if an object is an array?Using node.js as a simple web serverIs it possible to apply CSS to half of a character?Using Node.js require vs. ES6 import/exportES6: Conditional & Dynamic Import StatementsWhen should I use curly braces for ES6 import?Node.js - SyntaxError: Unexpected token import










3















i want to write below import in one single line. is it possible?



 `import SellerAdaptor from '../adaptors/sellers';
import UserAdaptor from '../adaptors/user';
import ShopEarnAdaptor from '../adaptors/shop_earn';
import ProductAdaptor from '../adaptors/product';
import JobAdaptor from '../adaptors/job';
import OrderAdaptor from '../adaptors/order';
import NotificationAdaptor from '../adaptors/notification';
import CategoryAdaptor from '../adaptors/category';
import AdminAdaptor from '../adaptors/adminAdaptor';`









share|improve this question

















  • 2





    Why'd you do that? What's wrong with multiline imports?

    – yunzen
    19 hours ago






  • 2





    Remove the line breaks, and it would be one single line....

    – Usagi Miyamoto
    19 hours ago






  • 2





    Do the back ticks (`) belong to your code?

    – yunzen
    19 hours ago







  • 1





    no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

    – AZ_
    19 hours ago











  • since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

    – Hitmands
    19 hours ago
















3















i want to write below import in one single line. is it possible?



 `import SellerAdaptor from '../adaptors/sellers';
import UserAdaptor from '../adaptors/user';
import ShopEarnAdaptor from '../adaptors/shop_earn';
import ProductAdaptor from '../adaptors/product';
import JobAdaptor from '../adaptors/job';
import OrderAdaptor from '../adaptors/order';
import NotificationAdaptor from '../adaptors/notification';
import CategoryAdaptor from '../adaptors/category';
import AdminAdaptor from '../adaptors/adminAdaptor';`









share|improve this question

















  • 2





    Why'd you do that? What's wrong with multiline imports?

    – yunzen
    19 hours ago






  • 2





    Remove the line breaks, and it would be one single line....

    – Usagi Miyamoto
    19 hours ago






  • 2





    Do the back ticks (`) belong to your code?

    – yunzen
    19 hours ago







  • 1





    no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

    – AZ_
    19 hours ago











  • since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

    – Hitmands
    19 hours ago














3












3








3








i want to write below import in one single line. is it possible?



 `import SellerAdaptor from '../adaptors/sellers';
import UserAdaptor from '../adaptors/user';
import ShopEarnAdaptor from '../adaptors/shop_earn';
import ProductAdaptor from '../adaptors/product';
import JobAdaptor from '../adaptors/job';
import OrderAdaptor from '../adaptors/order';
import NotificationAdaptor from '../adaptors/notification';
import CategoryAdaptor from '../adaptors/category';
import AdminAdaptor from '../adaptors/adminAdaptor';`









share|improve this question














i want to write below import in one single line. is it possible?



 `import SellerAdaptor from '../adaptors/sellers';
import UserAdaptor from '../adaptors/user';
import ShopEarnAdaptor from '../adaptors/shop_earn';
import ProductAdaptor from '../adaptors/product';
import JobAdaptor from '../adaptors/job';
import OrderAdaptor from '../adaptors/order';
import NotificationAdaptor from '../adaptors/notification';
import CategoryAdaptor from '../adaptors/category';
import AdminAdaptor from '../adaptors/adminAdaptor';`






javascript node.js ecmascript-6






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 19 hours ago









Deepak TyagiDeepak Tyagi

166




166







  • 2





    Why'd you do that? What's wrong with multiline imports?

    – yunzen
    19 hours ago






  • 2





    Remove the line breaks, and it would be one single line....

    – Usagi Miyamoto
    19 hours ago






  • 2





    Do the back ticks (`) belong to your code?

    – yunzen
    19 hours ago







  • 1





    no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

    – AZ_
    19 hours ago











  • since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

    – Hitmands
    19 hours ago













  • 2





    Why'd you do that? What's wrong with multiline imports?

    – yunzen
    19 hours ago






  • 2





    Remove the line breaks, and it would be one single line....

    – Usagi Miyamoto
    19 hours ago






  • 2





    Do the back ticks (`) belong to your code?

    – yunzen
    19 hours ago







  • 1





    no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

    – AZ_
    19 hours ago











  • since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

    – Hitmands
    19 hours ago








2




2





Why'd you do that? What's wrong with multiline imports?

– yunzen
19 hours ago





Why'd you do that? What's wrong with multiline imports?

– yunzen
19 hours ago




2




2





Remove the line breaks, and it would be one single line....

– Usagi Miyamoto
19 hours ago





Remove the line breaks, and it would be one single line....

– Usagi Miyamoto
19 hours ago




2




2





Do the back ticks (`) belong to your code?

– yunzen
19 hours ago






Do the back ticks (`) belong to your code?

– yunzen
19 hours ago





1




1





no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

– AZ_
19 hours ago





no you can't but if you need to you can create a factory like module for all imports check this stackoverflow.com/questions/34648195/…

– AZ_
19 hours ago













since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

– Hitmands
19 hours ago






since all of those modules live under adaptors, you might as well create an index.js file and put all the exports in there. Given that, all the consumers will import ... from '../adaptors'

– Hitmands
19 hours ago













3 Answers
3






active

oldest

votes


















6














No.



Destructuring would let you import many values from one module.



You can't import multiple modules at once.




A typical pattern here would be to have an ../adaptors/index which imported all the modules and then exported them:



import SellerAdaptor from './sellers';
import UserAdaptor from './user';
// etc
export SellerAdaptor, UserAdaptor, etc ;


Then you would be able to:



import SellerAdaptor, UserAdaptor, etc from "../adaptors/index";





share|improve this answer


















  • 1





    A better way to write this is export default as SellerAdaptor from './sellers'.

    – estus
    19 hours ago


















0














To be able to write import A, B, C from 'myPackage', it's upon myPackage and how it has been written.



If they are different files, you can't do it.
If you have one file adaptors that export the different modules, you can write your imports with the destructuring.






share|improve this answer






























    0














    You can do like as follows:



    import SellerAdaptor from '../adaptors/sellers';
    import UserAdaptor from '../adaptors/user';
    import ShopEarnAdaptor from '../adaptors/shop_earn';
    import ProductAdaptor from '../adaptors/product';
    import JobAdaptor from '../adaptors/job';
    import OrderAdaptor from '../adaptors/order';
    import NotificationAdaptor from '../adaptors/notification';
    import CategoryAdaptor from '../adaptors/category';
    import AdminAdaptor from '../adaptors/adminAdaptor';


    export
    SellerAdaptor,
    UserAdaptor,
    ShopEarnAdaptor,
    ProductAdaptor,
    JobAdaptor,
    OrderAdaptor,
    NotificationAdaptor,
    CategoryAdaptor,
    AdminAdaptor



    And Then You can Import like as follows



    import SellerAdaptor, UserAdaptor from './<filename>'





    share|improve this answer






















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021525%2fis-it-possible-to-destrucure-my-import-statements%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      6














      No.



      Destructuring would let you import many values from one module.



      You can't import multiple modules at once.




      A typical pattern here would be to have an ../adaptors/index which imported all the modules and then exported them:



      import SellerAdaptor from './sellers';
      import UserAdaptor from './user';
      // etc
      export SellerAdaptor, UserAdaptor, etc ;


      Then you would be able to:



      import SellerAdaptor, UserAdaptor, etc from "../adaptors/index";





      share|improve this answer


















      • 1





        A better way to write this is export default as SellerAdaptor from './sellers'.

        – estus
        19 hours ago















      6














      No.



      Destructuring would let you import many values from one module.



      You can't import multiple modules at once.




      A typical pattern here would be to have an ../adaptors/index which imported all the modules and then exported them:



      import SellerAdaptor from './sellers';
      import UserAdaptor from './user';
      // etc
      export SellerAdaptor, UserAdaptor, etc ;


      Then you would be able to:



      import SellerAdaptor, UserAdaptor, etc from "../adaptors/index";





      share|improve this answer


















      • 1





        A better way to write this is export default as SellerAdaptor from './sellers'.

        – estus
        19 hours ago













      6












      6








      6







      No.



      Destructuring would let you import many values from one module.



      You can't import multiple modules at once.




      A typical pattern here would be to have an ../adaptors/index which imported all the modules and then exported them:



      import SellerAdaptor from './sellers';
      import UserAdaptor from './user';
      // etc
      export SellerAdaptor, UserAdaptor, etc ;


      Then you would be able to:



      import SellerAdaptor, UserAdaptor, etc from "../adaptors/index";





      share|improve this answer













      No.



      Destructuring would let you import many values from one module.



      You can't import multiple modules at once.




      A typical pattern here would be to have an ../adaptors/index which imported all the modules and then exported them:



      import SellerAdaptor from './sellers';
      import UserAdaptor from './user';
      // etc
      export SellerAdaptor, UserAdaptor, etc ;


      Then you would be able to:



      import SellerAdaptor, UserAdaptor, etc from "../adaptors/index";






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered 19 hours ago









      QuentinQuentin

      651k728841047




      651k728841047







      • 1





        A better way to write this is export default as SellerAdaptor from './sellers'.

        – estus
        19 hours ago












      • 1





        A better way to write this is export default as SellerAdaptor from './sellers'.

        – estus
        19 hours ago







      1




      1





      A better way to write this is export default as SellerAdaptor from './sellers'.

      – estus
      19 hours ago





      A better way to write this is export default as SellerAdaptor from './sellers'.

      – estus
      19 hours ago













      0














      To be able to write import A, B, C from 'myPackage', it's upon myPackage and how it has been written.



      If they are different files, you can't do it.
      If you have one file adaptors that export the different modules, you can write your imports with the destructuring.






      share|improve this answer



























        0














        To be able to write import A, B, C from 'myPackage', it's upon myPackage and how it has been written.



        If they are different files, you can't do it.
        If you have one file adaptors that export the different modules, you can write your imports with the destructuring.






        share|improve this answer

























          0












          0








          0







          To be able to write import A, B, C from 'myPackage', it's upon myPackage and how it has been written.



          If they are different files, you can't do it.
          If you have one file adaptors that export the different modules, you can write your imports with the destructuring.






          share|improve this answer













          To be able to write import A, B, C from 'myPackage', it's upon myPackage and how it has been written.



          If they are different files, you can't do it.
          If you have one file adaptors that export the different modules, you can write your imports with the destructuring.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 19 hours ago









          HRK44HRK44

          471214




          471214





















              0














              You can do like as follows:



              import SellerAdaptor from '../adaptors/sellers';
              import UserAdaptor from '../adaptors/user';
              import ShopEarnAdaptor from '../adaptors/shop_earn';
              import ProductAdaptor from '../adaptors/product';
              import JobAdaptor from '../adaptors/job';
              import OrderAdaptor from '../adaptors/order';
              import NotificationAdaptor from '../adaptors/notification';
              import CategoryAdaptor from '../adaptors/category';
              import AdminAdaptor from '../adaptors/adminAdaptor';


              export
              SellerAdaptor,
              UserAdaptor,
              ShopEarnAdaptor,
              ProductAdaptor,
              JobAdaptor,
              OrderAdaptor,
              NotificationAdaptor,
              CategoryAdaptor,
              AdminAdaptor



              And Then You can Import like as follows



              import SellerAdaptor, UserAdaptor from './<filename>'





              share|improve this answer



























                0














                You can do like as follows:



                import SellerAdaptor from '../adaptors/sellers';
                import UserAdaptor from '../adaptors/user';
                import ShopEarnAdaptor from '../adaptors/shop_earn';
                import ProductAdaptor from '../adaptors/product';
                import JobAdaptor from '../adaptors/job';
                import OrderAdaptor from '../adaptors/order';
                import NotificationAdaptor from '../adaptors/notification';
                import CategoryAdaptor from '../adaptors/category';
                import AdminAdaptor from '../adaptors/adminAdaptor';


                export
                SellerAdaptor,
                UserAdaptor,
                ShopEarnAdaptor,
                ProductAdaptor,
                JobAdaptor,
                OrderAdaptor,
                NotificationAdaptor,
                CategoryAdaptor,
                AdminAdaptor



                And Then You can Import like as follows



                import SellerAdaptor, UserAdaptor from './<filename>'





                share|improve this answer

























                  0












                  0








                  0







                  You can do like as follows:



                  import SellerAdaptor from '../adaptors/sellers';
                  import UserAdaptor from '../adaptors/user';
                  import ShopEarnAdaptor from '../adaptors/shop_earn';
                  import ProductAdaptor from '../adaptors/product';
                  import JobAdaptor from '../adaptors/job';
                  import OrderAdaptor from '../adaptors/order';
                  import NotificationAdaptor from '../adaptors/notification';
                  import CategoryAdaptor from '../adaptors/category';
                  import AdminAdaptor from '../adaptors/adminAdaptor';


                  export
                  SellerAdaptor,
                  UserAdaptor,
                  ShopEarnAdaptor,
                  ProductAdaptor,
                  JobAdaptor,
                  OrderAdaptor,
                  NotificationAdaptor,
                  CategoryAdaptor,
                  AdminAdaptor



                  And Then You can Import like as follows



                  import SellerAdaptor, UserAdaptor from './<filename>'





                  share|improve this answer













                  You can do like as follows:



                  import SellerAdaptor from '../adaptors/sellers';
                  import UserAdaptor from '../adaptors/user';
                  import ShopEarnAdaptor from '../adaptors/shop_earn';
                  import ProductAdaptor from '../adaptors/product';
                  import JobAdaptor from '../adaptors/job';
                  import OrderAdaptor from '../adaptors/order';
                  import NotificationAdaptor from '../adaptors/notification';
                  import CategoryAdaptor from '../adaptors/category';
                  import AdminAdaptor from '../adaptors/adminAdaptor';


                  export
                  SellerAdaptor,
                  UserAdaptor,
                  ShopEarnAdaptor,
                  ProductAdaptor,
                  JobAdaptor,
                  OrderAdaptor,
                  NotificationAdaptor,
                  CategoryAdaptor,
                  AdminAdaptor



                  And Then You can Import like as follows



                  import SellerAdaptor, UserAdaptor from './<filename>'






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 19 hours ago









                  Sourabh SomaniSourabh Somani

                  1,142418




                  1,142418



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021525%2fis-it-possible-to-destrucure-my-import-statements%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                      Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                      2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived