Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cross-import

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-import - npm Package Compare versions

Comparing version 2.2.9 to 2.2.10

4

dist/index.d.ts

@@ -1,3 +0,1 @@

import fg from 'fast-glob';
export default function crossImport(source: string | fg.Pattern[], options?: fg.Options): any;
export { crossImport };
export default function crossImport(modulePath: string): any;

@@ -1,1 +0,1 @@

{"name":"cross-import","scripts":{"build:cjs":"esbuild src/index.ts --bundle --outfile=dist/index.js --format=cjs --minify --sourcemap --platform=node --external:esbuild --external:fast-glob --external:jiti --external:@techor/extend --external:sucrase --external:upath","build:type":"tsc --emitDeclarationOnly --preserveWatchOutput","build":"npm run build:cjs && npm run build:type","dev":"conc 'npm:build:* -- --watch'","test":"node -r sucrase/register ./tests/real && jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Import .ts, .mjs, .cjs files across environments as JavaScript modules","author":{"name":"Aron","email":"i@aron.tw","url":"http://aron.tw"},"homepage":"https://aron.tw","bugs":{"url":"https://github.com/1aron/utils/issues"},"repository":{"type":"git","url":"https://github.com/1aron/utils.git","directory":"packages/read-module"},"keywords":["cjs","mjs","config","utils","module","read","cross","environments","commonjs","ts","typescript"],"sideEffects":false,"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.js","types":"./dist/index.d.ts"}},"files":["dist"],"dependencies":{"@techor/extend":"^2.2.9","fast-glob":"^3.2.12","jiti":"^1.18.2","sucrase":"^3.32.0","upath":"^2.0.1"},"version":"2.2.9"}
{"name":"cross-import","scripts":{"build:cjs":"esbuild src/index.ts --bundle --outfile=dist/index.js --format=cjs --minify --sourcemap --platform=node","build:type":"tsc --emitDeclarationOnly --preserveWatchOutput","build":"npm run build:cjs && npm run build:type","dev":"conc 'npm:build:* -- --watch'","test":"node -r sucrase/register ./tests/real && jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Import .ts, .mjs, .cjs files across environments as JavaScript modules","author":{"name":"Aron","email":"i@aron.tw","url":"http://aron.tw"},"homepage":"https://aron.tw","bugs":{"url":"https://github.com/1aron/utils/issues"},"repository":{"type":"git","url":"https://github.com/1aron/utils.git","directory":"packages/read-module"},"keywords":["cjs","mjs","config","utils","module","read","cross","environments","commonjs","ts","typescript"],"sideEffects":false,"publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.js","import":"./dist/index.js","types":"./dist/index.d.ts"}},"files":["dist"],"devDependencies":{"sucrase":"^3.32.0","jiti":"^1.18.2"},"version":"2.2.10"}

@@ -71,6 +71,3 @@ <br>

```ts
crossImport(
source: string | fg.Pattern[],
options?: fg.Options
): any
crossImport(modulePath: string): any
```

@@ -96,21 +93,3 @@

```
And so on...
### Import format-multiple JS config
This is often used to read various user-defined configuration files like `master.css.ts`, `next.config.js`, `vite.config.mjs` ...
`index.js`
```js
crossImport('master.css.{js,ts,cjs,mjs}')
// {"bar": "bar", "foo": "foo"}
```
## Options
Inherited from [fast-glob options](https://github.com/mrmlnc/fast-glob#options-3)
```js
{
cwd: process.cwd()
}
```
<br>

@@ -117,0 +96,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc