diff --git a/README.md b/README.md index 4d19f85..7fdd648 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ Full 7zip Console Commands. The `7z` and `7za` binary on your system is located in directory: ...\...\node-7z-archive\binaries\... ``` -> ____This package is a rewrite of [node-7z-forall](https://github.com/techno-express/node-7z-forall)____. The original author has removed the version it was a fork of [node-7z](https://github.com/quentinrossetti/node-7z). +> ____This package is a rewrite of [node-7z-forall](https://github.com/techno-express/node-7z-forall)____. The original author has removed the version it was a fork of [node-7z](https://github.com/quentinrossetti/node-7z). The methods are still backwards compatible with previous naming of `add`, `delete`, `extract`, `extractFull`, `list`, `rename`, `test`, `update`. API --- diff --git a/lib/index.js b/lib/index.js index b321378..14d3cd8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -6,7 +6,7 @@ import { Files, ReplaceNativeSeparator, Run } from './utility.js'; import { createSfx } from './createSfx.js'; import { isWindows } from 'node-sys'; -function retry(command, options, override, progress, onprogress, resolve, reject, archive, noRetry = false) { +function retry(command, options, override, progress, onprogress, resolve, reject, archive) { // Start the command return Run('7z', command, options, override) .progress(function (data) { @@ -50,7 +50,7 @@ function retry(command, options, override, progress, onprogress, resolve, reject * * @returns {Promise} Promise */ -export const createArchive = SevenZip.createArchive = function (filepath, files, options, override = false) { +export const createArchive = SevenZip.createArchive = SevenZip.add = function (filepath, files, options, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When @@ -91,7 +91,7 @@ export const createArchive = SevenZip.createArchive = function (filepath, files, * * @returns {Promise} Promise */ -export const deleteArchive = SevenZip.deleteArchive = function (filepath, files, options, override = false) { +export const deleteArchive = SevenZip.deleteArchive = SevenZip.delete = function (filepath, files, options, override = false) { return new Promise(function (resolve, reject) { // Convert array of files into a string if needed. @@ -136,7 +136,7 @@ export const deleteArchive = SevenZip.deleteArchive = function (filepath, files, * * @returns {Promise} Promise */ -export const extractArchive = SevenZip.extractArchive = function (filepath, dest = '*', options = {}, override = false) { +export const extractArchive = SevenZip.extractArchive = SevenZip.extract = function (filepath, dest = '*', options = {}, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When @@ -175,7 +175,7 @@ export const extractArchive = SevenZip.extractArchive = function (filepath, dest * * @returns {Promise} Promise */ -export const fullArchive = SevenZip.fullArchive = function (filepath, dest = '*', options = {}, override = false) { +export const fullArchive = SevenZip.fullArchive = SevenZip.extractFull = function (filepath, dest = '*', options = {}, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When @@ -212,7 +212,7 @@ export const fullArchive = SevenZip.fullArchive = function (filepath, dest = '*' * * @returns {Promise} Promise */ -export const listArchive = SevenZip.listArchive = function (filepath, options, override = false) { +export const listArchive = SevenZip.listArchive = SevenZip.list = function (filepath, options, override = false) { return when.promise(function (resolve, reject, progress) { let spec = {}; /* jshint maxlen: 130 */ @@ -310,7 +310,7 @@ export const listArchive = SevenZip.listArchive = function (filepath, options, o * * @returns {Promise} Promise */ -export const onlyArchive = SevenZip.onlyArchive = function (filepath, dest, files, options = {}, override = false) { +export const onlyArchive = SevenZip.onlyArchive = SevenZip.only = function (filepath, dest, files, options = {}, override = false) { return when.promise(function (resolve, reject, progress) { options = Object.assign(options, { files: files }); @@ -351,7 +351,7 @@ export const onlyArchive = SevenZip.onlyArchive = function (filepath, dest, file * * @returns {Promise} Promise */ -export const renameArchive = SevenZip.renameArchive = function (filepath, files, options, override = false) { +export const renameArchive = SevenZip.renameArchive = SevenZip.rename = function (filepath, files, options, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When @@ -392,7 +392,7 @@ export const renameArchive = SevenZip.renameArchive = function (filepath, files, * * @returns {Promise} Promise */ -export const testArchive = SevenZip.testArchive = function (filepath, options, override = false) { +export const testArchive = SevenZip.testArchive = SevenZip.test = function (filepath, options, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When @@ -431,7 +431,7 @@ export const testArchive = SevenZip.testArchive = function (filepath, options, o * * @returns {Promise} Promise */ -export const updateArchive = SevenZip.updateArchive = function (filepath, files, options, override = false) { +export const updateArchive = SevenZip.updateArchive = SevenZip.update = function (filepath, files, options, override = false) { return when.promise(function (resolve, reject, progress) { /** * When a stdout is emitted, parse each line and search for a pattern.When diff --git a/package-lock.json b/package-lock.json index ec32fec..9f8ae83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "node-7z-archive", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 606deda..ba47e0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-7z-archive", - "version": "1.0.3", + "version": "1.0.4", "description": "ESM front-end to 7-Zip, featuring alternative full 7z CLI tools, binaries for Linux, Windows, Mac OSX, seamlessly create 7zip SFX self extracting archives targeting different platforms.", "type": "module", "main": "lib/index.js",