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

babel-resolver

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-resolver - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

2

package.json
{
"name": "babel-resolver",
"version": "0.0.11",
"version": "0.0.12",
"description": "Resolve modules from any directory.",

@@ -5,0 +5,0 @@ "main": "lib/createBabelResolver.js",

@@ -18,7 +18,7 @@ # Babel Resolver [![NPM version][npm-image]][npm-url] [![Build status][travis-image]][travis-url] [![Coverage status][coveralls-image]][coveralls-url]

In app/index.js:
```javascript
var path = require('path');
var localModulesDir = path.resolve(__dirname, 'app');
var anotherDirToCheck = path.resolve(__dirname, 'app/lib');
var resolver = require('babel-resolver')(localModulesDir, anotherDirToCheck);
var localModulesDir = __dirname;
var resolver = require('babel-resolver')(localModulesDir);

@@ -29,4 +29,13 @@ require('babel-core/register')({

});
require('./app');
require('./app.js');
```
In app/app.js:
```javascript
import User from 'models/User';
// => resolves: "app/models/User.js"
```
**Note:** Run `rm -rf ~/.babel.json` if you're seeing errors.

@@ -38,2 +47,29 @@

## Resolving Multiple Directories
In app/index.js:
```javascript
var path = require('path');
var localModulesDir = __dirname;
var anotherDirToCheck = path.resolve(__dirname, 'lib');
var resolver = require('babel-resolver')(localModulesDir, anotherDirToCheck);
require('babel-core/register')({
presets: ['es2015'],
resolveModuleSource: resolver
});
require('./app');
```
In app/app.js:
```javascript
import User from 'models/User';
// => resolves: "app/models/User.js"
import somethingInLib from 'somethingInLib';
// => resolves: "app/lib/somethingInLib.js"
```
## Installation

@@ -40,0 +76,0 @@

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