Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Folport allows you to import all modules from a folder in a single step, organizing them in a clean and accessible way.
To install, run this command:
npm install folport
"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"
}
}
Suppose we have the following folder structure:
+-- math
| +-- add.js
| +-- subtract.js
| +-- multiply.js
| +-- divide.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
Imports modules from a folder
The npm package folport receives a total of 0 weekly downloads. As such, folport popularity was classified as not popular.
We found that folport demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.