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

                      Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

                      Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

                      How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page