Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
A simple promise-based wrapper for file operations that treats files as objects.
A simple promise-based wrapper for file operations that treats files as objects.
File = require 'fobject'
configFile = new File('config.json')
configFile.read().done((data) ->
console.log "contents of #{configFile.path}: #{data}"
)
Also, this includes a 2nd wrapper that extends the first and lets you cache the contents of the file directly in the object
File = require 'fobject/cached'
logFile = new File('log')
logFile.load().then( ->
console.log logFile.content # print out the logs
logFile.content += 'this is a demo\n' # add a line
).then(
logFile.save
).done( ->
console.log('the logs are saved, and since we only added to the string, the
`File.save()` call was optimized into a single `append()`')
)
Read the source code for now... it's all well annotated in JSDoc.
FAQs
A simple promise-based wrapper for file operations that treats files as objects.
The npm package fobject receives a total of 7,962 weekly downloads. As such, fobject popularity was classified as popular.
We found that fobject demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.