Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SteelAlloy committed Aug 29, 2019
2 parents 891c8cf + 30c5f56 commit 1c250e4
Show file tree
Hide file tree
Showing 20 changed files with 41 additions and 401 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ assignees: ''

---

**Origin of the bug**

Please delete options that are not relevant.
- [ ] npm module version
- [ ] command-line version
- [ ] both

**Describe the bug**

A clear and concise description of what the bug is.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/tmp
/yarn.lock
/coverage
node_modules
/node_modules
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
name: Travis CI

language : node_js

node_js:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [3.0.0] - 2019-08-29

### Added
- Dependabot.

### Removed
- CLI support. See [secure-rm-cli](https://www.npmjs.com/package/secure-rm-cli)
- Unused packages.

## [2.0.1] - 2019-08-27

### Added
Expand Down
92 changes: 27 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,7 @@ To install this package, just run: (Node and npm required)
npm install secure-rm
```

Or the _command-line version_: **🚨 Deprecated 🚨**

```shell
npm install secure-rm -g
```

Move over `secure-rm-cli`:

```shell
npm install secure-rm-cli -g
```

Looking for a **command line interface**? See: [secure-rm-cli](https://www.npmjs.com/package/secure-rm-cli)

Secure-rm will retry 3 times if an error occur to ensure the task succeeded.

Expand Down Expand Up @@ -73,14 +62,6 @@ srm('./folder/*.js')
.catch((err) => {throw err})
```

### Command line version **🚨 Deprecated 🚨**
**(soon deprecated, will be ported to secure-rm-cli)**

If you want to delete files on the fly, just use the command line tool:
```shell
secure-rm ./folder/*.js
```

## 📚 Usage

**`rm(path[, options] [, callback])`**
Expand Down Expand Up @@ -148,56 +129,37 @@ srm.event.on('warn', (file, err) => console.log('Warning ' + err + file))
srm.event.on('error', (file, err) => console.log('Error ' + err + file))
```
### Command line tool **🚨 Deprecated 🚨**
```shell
secure-rm <PATHS> [OPTIONS]
### The `srm` Object
When you import the library, you can do this in two different ways:
```javascript
const srm = require('secure-rm')
```
- `PATHS`:
- one or multiple paths (e.g. `D:\data /d/data ./data/file.js ../../data`)
- supports [glob patterns](https://www.npmjs.com/package/glob#glob-primer) (e.g. `./*.js ./**/* @(pattern|pat*|pat?erN)`)
- `OPTIONS` (flags):
- `-f, --force`: avoid checks if you want to use it in a shell or bash file;
- `-h, --help`: show CLI help, see below;
- `-s, --standard`: numerical ID of the standard, default is 0. See them detailed below;
- `-r, --retries`: max retries if an error occur;
- `-t, --table `: show the standards table. See them detailed below;
- `-v, --version `: show CLI version;
- `--no-globbing `: disable file globbing.
Example:
```shell
secure-rm ./folder/*.js ./file.js -s gutmann -f
And then get the properties:
```javascript
srm.event
srm.write
srm.validIDs
...
```
Or you can import each property:
```javascript
import srm, { event, write, standard, validIDs, UnlinkStandard } from 'secure-rm'
// Or
const { event, write, standards, validIDs, UnlinkStandard } = require('secure-rm')
```
You can invoke the built-in help with `secure-rm -h`:
<!--AUTO GENERATED HELP START-->
```shell
CLI help:
USAGE
$ secure-rm PATH
OPTIONS
-f, --force avoid checks
-h, --help show CLI help
-m, --mute mutes the cli to the bare minimum
-r, --retries=retries [default: 3] max retries if error
-s, --standard=standard [default: secure] select the erasure standard
-t, --table show the standards table
-v, --version show CLI version
--[no-]globbing allow or not file globbing
DESCRIPTION
Completely erases files by making recovery impossible.
For extra documentation, go to https://www.npmjs.com/package/secure-rm
It is structured as follows:
EXAMPLES
$ secure-rm ./folder/*.js ./file.js -s gutmann -f
$ secure-rm /d/code -m
```
<!--AUTO GENERATED HELP END-->
`srm` [\<Function\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) :
The main function, as described [above](#-usage).
- `event` [\<events.EventEmitter\>](https://nodejs.org/dist/latest-v12.x/docs/api/events.html) : event object to follow the process, as described [above](#-events);
- `write` [Object\<Function\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) : the object containing writing funtions, see [write.js](./lib/write.js);
- `standard` [Object\<UnlinkStandard\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) : the object containing the standards;
- `validIDs` [Array\<String\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) : array containing valid text IDs of standards;
- `UnlinkStandard` [\<UnlinkStandard\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) : the class to create new standards.
### Standards
## Standards
ID | Name | Passes | Description
-- | ---- | ------ | -----------
Expand Down
Binary file removed assets/built-in_help.png
Binary file not shown.
4 changes: 0 additions & 4 deletions bin/run

This file was deleted.

4 changes: 0 additions & 4 deletions bin/run-dev

This file was deleted.

3 changes: 0 additions & 3 deletions bin/run-dev.cmd

This file was deleted.

3 changes: 0 additions & 3 deletions bin/run.cmd

This file was deleted.

26 changes: 4 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "secure-rm",
"version": "2.0.1",
"version": "3.0.0",
"description": "Completely erases files by making recovery impossible.",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"start": "node bin/run",
"start-dev": "node bin/run-dev",
"build": "npm run build-ts && npm run lint",
"build-ts": "tsc",
"watch-ts": "tsc -w",
Expand All @@ -17,18 +15,11 @@
"style": "standard --verbose --env jest"
},
"dependencies": {
"@oclif/command": "^1.5.18",
"@oclif/parser": "^3.8.4",
"@types/rimraf": "^2.0.2",
"chalk": "^2.4.2",
"glob": "^7.1.4",
"inquirer": "^6.5.2",
"ololog": "^1.1.146",
"rimraf": "^2.6.3",
"tslib": "^1.10.0",
"tty-table": "^2.7.3"
"rimraf": "^3.0.0",
"tslib": "^1.10.0"
},
"devDependencies": {
"@types/rimraf": "^2.0.2",
"@types/jest": "^24.0.18",
"coveralls": "^3.0.6",
"jest": "^24.8.0",
Expand All @@ -48,15 +39,6 @@
"engines": {
"node": ">=8.0.0"
},
"oclif": {
"bin": "secure-rm"
},
"np": {
"yarn": false
},
"bin": {
"secure-rm": "./bin/run"
},
"files": [
"/dist",
"/bin"
Expand Down
84 changes: 0 additions & 84 deletions src/cli/check.ts

This file was deleted.

24 changes: 0 additions & 24 deletions src/cli/deprecated.ts

This file was deleted.

Loading

0 comments on commit 1c250e4

Please sign in to comment.