
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
disk-action
Advanced tools
Easy to use module in order to create / delete / modify files and directory. All unexistent directories will be create 'on-the-fly', and delete works for either file or directory. ** BE CAREFUL ** when specifying directory: all content will be erased !!
Important: This package is NOT backward compatible with 0.1.x versions... Be careful if you update your npm project...
Install with npm:
npm install disk-action
Require the module:
Disk = require 'disk-action'
Initialize with encoding (default is 'utf-8'):
disk = new Disk('utf-8')
Read a file:
disk.read
filename: 'directory/not/created/hello.txt'
cb: (data) ->
console.log data
disk.read
filename: 'directory/not/created/hello.txt'
cb: (data) ->
console.log data
disk.create
filename: 'directory/not/created/hello.txt'
content: 'I like coffee'
cb: () ->
console.log 'File created'
disk.create
filename: 'directory/not/created/hello.txt'
content: 'I like coffee'
disk.create
dirname: 'another/directory'
disk.append
filename: 'directory/not/created/hello.txt'
content: 'But JS is not my best friend... ;)'
disk.copy
source: 'directory/not/created/hello.txt'
destination: 'another/directory/hello2.txt'
disk.move
source: 'directory/not/created/hello.txt'
destination: 'another/directory/hello2.txt'
disk.replace
filename: 'directory/not/created/hello.txt'
to_replace: 'coffee'
replace_with: 'CoffeeScript'
disk.delete
filename: 'directory/not/created/hello.txt'
All methods supports an optional callback parameter:
disk.write
filename: 'directory/not/created/hello.txt'
content: 'I like coffee'
cb: do_something()
or:
disk.read
filename: 'directory/not/created/hello.txt'
cb: (data) ->
console.log data
You can run unit-tests using mocha with:
npm test
FAQs
Implement standard disk actions
We found that disk-action 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.