Socket
Book a DemoInstallSign in
Socket

browserify-casesensitiverequire

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-casesensitiverequire

A simple browserify transform to ensure that the case of require()'d file names are consistent, and warn the user if they aren't

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
9
125%
Maintainers
1
Weekly downloads
 
Created
Source

browserify-casesensitiverequire

This project is no longer maintained

A simple browserify transform to ensure that the case of require()'d file names are consistent, and warn the user if they aren't. This makes sure that browersify code that is written on Windows will also work on *nix's.

Example usage (command line)

npm i browserify-casesensitiverequire -g
browserify -t browserify-casesensitiverequire ./myindex.js

I was originally tempted to create a transform that would automatically alter the case for you, however this seemed like bad practice so I have opted for emitting warnings instead.

If the same file is require()'d by Browserify using different casing, on Windows this will cause the same file to be processed & compiled twice (which works, but is undesirable). On case-sensitive file systems, the operation will fail. So we have code that can build on Windows but not unix. This transform aims to resolve that, by warning the developer they have require()'d the same file at different points in their code using different casing.

Example

File: index1.js

var a = require( './index3.js' );

File: index2.js

var b = require( './INDEX3.js' );

This will emit a warning that index3.js is referenced in multiple files using different casing.

Example (using relative paths from different subfolders)

File: index1.js

var a = require( './index3.js' );

File: subfolder/index2.js

var b = require( '../INDEX3.js' );

browserify-casesensitiverequire is smart enough to figure out that they are referencing the same index3.js, so will also emit a warning.

Keywords

browserify-transform

FAQs

Package last updated on 06 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.