10 examples of 'import * as es6' in JavaScript

Every line of 'import * as es6' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
55export async function importSetGlobal (url, {global: glob, returnDefault}) {
56 // Todo: Replace calls to this function with `import()` when supported
57 const modularVersion = !('svgEditor' in window) ||
58 !window.svgEditor ||
59 window.svgEditor.modules !== false;
60 if (modularVersion) {
61 return importModule(url, undefined, {returnDefault});
62 }
63 await importScript(url);
64 return window[glob];
65}
168function es6Import(graphql, types, opts) {
169 var declarations = [
170 b.importDeclaration(
171 [importSpecifier('getEntityResolver', true)],
172 b.literal('./util/entity-resolver')
173 )
174 ];
175
176 if (graphql.length) {
177 declarations.push(b.importDeclaration(
178 graphql.map(importSpecifier),
179 b.literal('graphql')
180 ));
181 }
182
183 if (opts.relay && opts.isFromSchema) {
184 declarations.push(b.importDeclaration(
185 [importSpecifier('nodeField')],
186 b.literal('./types/Node')
187 ));
188 }
189
190 declarations = declarations.concat(
191 types.map(function(item) {
192 return b.importDeclaration(
193 [importSpecifier(item, true)],
194 b.literal('./types/' + item)
195 );
196 })
197 );
198
199 declarations.push(b.importDeclaration(
200 [importSpecifier('registerType')],
201 b.literal('./resolve-map')
202 ));
203
204 declarations.push(b.importDeclaration(
205 [{
206 type: 'ImportNamespaceSpecifier',
207 id: {
208 type: 'Identifier',
209 name: 'types'
210 }
211 }],
212 b.literal('./types')
213 ));
214
215 return declarations;
216}
53import(nameOrModules: string | { [name: string]: any }, mod?: any) {
54 if (typeof nameOrModules === 'string') {
55 nameOrModules = { [nameOrModules]: mod }
56 }
57
58 if (typeof nameOrModules !== 'object') return
59
60 const names = getOwnNames(nameOrModules)
61
62 for (let i = 0; i < names.length; i++) {
63 const name = names[i]
64 const pointer = this.state.symbols.set(name, 'var').pointer
65 this.state.context[pointer] = { store: nameOrModules[name] }
66 }
67}
216value: function _import(pathToModule) {
217 return require(this.root(pathToModule));
218}
266function import$(obj, src){
267 var own = {}.hasOwnProperty;
268 for (var key in src) if (own.call(src, key)) obj[key] = src[key];
269 return obj;
270}
168function __import(obj, src){
169 var own = {}.hasOwnProperty;
170 for (var key in src) if (own.call(src, key)) obj[key] = src[key];
171 return obj;
172}
134function importAddonToAMD(name, path, { applicationName, projectRoot }) {
135 return new Promise((resolve, reject) => {
136 Promise.all([
137 importAddonFolderToAMD(name, `${path}/addon`, projectRoot),
138 importAddonFolderToAMD(applicationName, `${path}/app`, projectRoot)
139 ])
140 .then((content) => resolve(content.join('\n')))
141 .catch((error) => {
142 console.log('error is', error);
143 reject(error);
144 });
145 });
146}
29function importAll(module, globalObj)
30{
31 var exports = require(module);
32 for (var key in exports)
33 globalObj[key] = exports[key];
34}
70function _load_import() {
71 return _import = _interopRequireWildcard(require('./import.js'));
72}
6function importAll(r) {
7 r.keys().forEach(function (key) {
8 const fileName = key.split('/').pop().replace(/\..+$/, '');
9 cache[fileName] = r(key)
10 });
11}

Related snippets