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

folport

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

folport

Imports modules from a folder

  • 1.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

Folport banner

Folport

CI CD

Folport allows you to import all modules from a folder in a single step, organizing them in a clean and accessible way.

Getting Started

To install, run this command:

npm install folport

Important: Setting "type": "module"

Since Folport uses ES Modules (import/export syntax), you need to specify "type": "module" in your package.json file. This setting is essential to ensure Node.js interprets your code correctly as ES Modules.

{
  "name": "your-project-name",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
    "folport": "^1.0.0"
  }
}

Example

Suppose we have the following folder structure:

+-- math
|  +-- add.js
|  +-- subtract.js
|  +-- multiply.js
|  +-- divide.js
+-- index.js
index.js
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';

import folport from 'folport';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

async function main() {
  const math = await folport(join(__dirname, 'math'))

  console.log(math.add(1, 2))      // 3
  console.log(math.subtract(8, 4)) // 4
  console.log(math.multiply(6, 7)) // 42
  console.log(math.divide(20, 10)) // 2
}

main()

Black Tech by Gabriel Rufino 🖤

FAQs

Package last updated on 10 Jan 2025

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