I have some code:  baseTypes.ts  export namespace Living.Things {   export class Animal {     move() { /* ... */ }   }   export class Plant {     photosynthesize() { /* ... */ }   } }   dog.ts  import b = require('./baseTypes');  export nam...
I need to do something like:  if (condition) {     import something from 'something'; } // ... if (something) {     something.doStuff(); }   The above code does not compile; it throws SyntaxError: ... 'import' and 'export' m...
What is the different between two declarations of a module in JavaScript? One has parentheses around the function and other one doesn't?  One article says that     Notice the () around the anonymous function.  This is required by the   language...
I've seen public exports of ES6 modules done in both of the following ways:  // method 1 export var getAnswer = function () { return 'forty two'; };  // method 2 export default function () { return 'forty two'; };    Are both of...
Looking at a random source file of the express framework for NodeJS, there are two lines of the code that I do not understand (these lines of code are typical of almost all NodeJS files).  /**  * Expose `Router` constructor.  */  exports = module.exp...
When I updated Angular from 7 to Angular 8, getting error for lazy loading modules  I have tried the options, which are there in the angular upgradation guide  Made the below changes:  Before      loadChildren: '../feature/path/sample-...
I'm wanting to programmatically generate the exports for a module, is this possible in es6?  Something along these lines:  const ids = ['foo', 'bar', 'baz'];  ids.forEach(id => {     export const [id.toUpperCase()] = id...
I have some components in my vue project. I don't like  import loader from '@/components/someComponent1/someComponent1.vue'; because it's a lot to write and I have to repeat it for every component. So I wrote an index.jsfor the compon...
I want to add or override some standard methods of Object, Function and Array (e.g., like suggested in this answer) in node.js application. How should I do all the "patches" in just one module so that it affects all my other modules?  Will it...
I'm new to npm module and node.js so it is really difficult to me.  I have a js code whit many points and for each one of them I want to get the nearest city.  To do this, in other question (Reverse geocoding with big array is fastest way? - java...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.