New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fuzzquire

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fuzzquire

Fuzzy require modules from your project.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Fuzzquire

Easier in-project module loading for cleaner and more readable code.

Fuzzquire is a wrapper around require. You only need to specify the minimum number of file path parts and the file name to load the file in your project, and thus, you increase the code readability as well as reduce the cognitive load on yourself while coding as you do not have to remember the relative file paths anymore. Bliss!

Try it out: npm install fuzzquire --save.

Example

Let's take a directory structure like:

project-folder
├── app.js
├── package.json
├── routes
│   ├── api
│   │   ├── index.js
│   │   ├── notify.js
│   │   ├── services
│   │   │   ├── events.js
│   │   │   └── users.js
│   │   └── typeahead.js
│   ├── auth.js
│   ├── components
│   │   ├── custom
│   │   │   └── pybits.js
│   │   ├── custom.js
│   │   ├── dashboard.js
│   │   ├── index.js
│   │   ├── login.js
│   │   └── portals.js
│   ├── export.js
│   ├── index.js
│   ├── transaction.js
│   └── upload.js
├── utils
│   ├── authentication.js
│   ├── config-loader.js
│   ├── service.constructor.js
│   └── state.js

Now, this is what some file would look before fuzzquire:

const Users = require('../api/services/users');
const auth = require('../../utils/authentication');
const config = require('../../utils/config-loader');
const pybits = require('./custom/pybits');
const app = require('../../app').express;
...

And this would be the same file after fuzzquire:

const fq = require('fuzzquire');
const Users = fq('api/users');
const auth = fq('authentication');
const config = fq('config-loader');
const pybits = fq('pybits');
const app = fq('app').express;

Contributing

Contributions are welcomed. If you want a feature or find a bug, please open an issue and I'll try to resolve it quickly.

Keywords

FAQs

Package last updated on 15 Sep 2020

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

  • 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