
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Robust operating system directory functionality
npm install ack-path
How to import this package
var Path = require('ack-path')(__dirname)
console.log( Path.path === __dirname )//true test
//Now, you can do a whole lot more! Continue reading...
Timesaver script commands
Using the most basic command as an example, you can invoke the copy command, using any of the following methods:
package.json script example
"scripts":{
"copy": "ack-path copy ./relativeFrom ./relativeTo"
}
from command terminal example
./node_modules/bin/ack-path copy ./relativeFrom ./relativeTo
ack-path copy ./relativeFrom ./relativeTo
ack-path move ./relativeFrom ./relativeTo
ack-path delete ./relativePath
write file promise
Path.join('file-name.js').writeFile(string).then().catch()
Create directory if not existant. Does not take into condsideration if path is actually a file (file path will be created as a folder)
Path.param().then()
Create directory if not existant. Takes condsideration if path is actually a file and only creates folder pathing
Returns promise with context of this Path
Path.paramDir().then()
Path.copyTo(__dirname+'-copy').then()
move entire directory or single file
Path.moveTo( newPath:string, overwrite:boolean ).then()
Path.moveTo(__dirname+'-moved').then()
in-place rename directory or single file
Path.rename( newName:string, overwrite:boolean ).then()
Path.rename('new-item-name', true).then()
path delete promise
Path.delete().then()
file and folder looper
Path.each( itemStringPath=>itemStringPath ).then( itemPathArray=>console.log(itemPathArray) )
Loop folder to fire callback for each file found. Only produces file results. see eachPath function
Path.eachFilePath( fileStringPath=>fileStringPath ).then( filePathArray=>console.log(filePathArray) )
Recursively loop folder to fire callback for each item found. See eachPath function
Path.recur( ItemPath=>ItemPath.path ).then( pathStringArray=>console.log(pathStringArray) )
Recursively loop folder to fire callback for each file found. See eachPath function
Path.recurFiles( filePath=>console.log('file', filePath) )
var PathTest = require('ack-path')('/test/file.js')
PathTest.removeExt().path == "/test/file"
PathTest.removeFile().path == "/test/"
hard-checks file system if item is a folder
require('ack-path')('/test/file.js').isDirectory().then(res=>res==false)
hard-checks file system if item is a file
require('ack-path')('/test/file.js').isFile().then(res=>res==true)
Checks string for a file extension
require('ack-path')('/test/file.js').isLikeFile() == true
Returns item after last slash
require('ack-path')('/test/file.js').getLastName() == 'file.js'
require('ack-path')('/test/folder/').getLastName() == 'folder'
considers if path is actually a file
PathSync.dirExists()
PathSync.exists()
PathSync.delete()
PathSync.copyTo()
PathSync.copyTo()
A more file specific set of objective functionality
var File = require('ack-path')(__dirname).file('file-name.js')
var filePath = File.path
File.copyTo(__filename+'.copy').then()
File.moveTo(__filename+'.newname').then()
File.delete().then()
File.getMimeType()//Ex: application/javascript
File.stat().then(stats=>stats.size)
File.write(string).then()
just like write but if file already exists, no error will be thrown
File.param(string).then()
File.append(string).then()
File.readJson().then()
FAQs
Robust operating system directory functionality
The npm package ack-path receives a total of 120 weekly downloads. As such, ack-path popularity was classified as not popular.
We found that ack-path 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.