![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
ar-async
Advanced tools
Readme
A Node library for asynchronously reading and writing Unix archive files. Currents supprts basic ar
format, as well as BSD and GNU variants.
###ArReader
var ar = require('ar'),
fs = require('fs'),
path = require('path');
// extracts all of the files in "some_archive.a" to the folder "./output".
var outputDir = "./output";
if (!fs.existsSync(outputDir)) fs.mkdirSync(outputDir);
var reader = new ar.ArReader("some_archive.a");
reader.on("open", function() {
// archive opened
});
reader.on("entry", function(entry, next) {
// entry is an instance of ArEntry
var name = entry.fileName();
entry.fileData()
.pipe(fs.createWriteStream(name))
.on("finish", next);
});
reader.on("error", function(err) {
// archive reading error
});
reader.on("end", function() {
// archive parsing ended
});
reader.on("close", function() {
// archive closed
});
ArReader automatically detects and handles BSD and GNU variant formats. All events are optional, so you only have to listen for the ones you want.
###ArWriter
var ar = require('ar'),
fs = require('fs'),
path = require('path');
// write files into a new ar archive at "some_archive.a"
// in the case, specifies gnu variant format for long filenames
var writer = new ar.ArWriter("./some_archive.a", {variant:"gnu"});
writer.writeEntries([
"./some_file",
"./some_other_file",
"./yet_another_file"
], function() {
// optional callback after completion
});
writer.on("open", function() {
// archive opened
});
writer.on("entry", function(entry) {
// entry is an instance of ArEntry
// signifies an entry has been written
// unlike ArReader, there is no next function
});
writer.on("error", function(err) {
// archive writing error
});
writer.on("finish", function() {
// archive writing ended and closed
});
ArWriter by default will truncate filenames at 16 bytes long. For long file names, specify a variant format, like done above. Currently "GNU" and "BSD" are supported. Additionally, you can specify "uid", "gid", and "mode" number values in the options json; they will override the values for each file written. All events are optional, so you only have to listen for the ones you want.
###ArEntry See ar.js for inline ArEntry documention, but here are the key APIs
###License Licensed under the MIT License (MIT)
node-ar-async Copyright (c) 2014 Jason Robitaille. https://github.com/JayCanuck/node-ar-async
Based on, and including code from, from node-ar, Copyright (c) 2013 John Vilk. https://github.com/jvilk/node-ar
FAQs
Asynchronously read and write Unix archive files.
The npm package ar-async receives a total of 12,885 weekly downloads. As such, ar-async popularity was classified as popular.
We found that ar-async 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.