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

Commit 1c250e4

Browse files
authored
3.0.0
2 parents 891c8cf + 30c5f56 commit 1c250e4

20 files changed

+41
-401
lines changed

.eslintrc

-3
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ assignees: ''
77

88
---
99

10-
**Origin of the bug**
11-
12-
Please delete options that are not relevant.
13-
- [ ] npm module version
14-
- [ ] command-line version
15-
- [ ] both
16-
1710
**Describe the bug**
1811

1912
A clear and concise description of what the bug is.

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
/tmp
55
/yarn.lock
66
/coverage
7-
node_modules
7+
/node_modules

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Travis CI
2-
31
language : node_js
42

53
node_js:

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
## [Unreleased]
1616

17+
## [3.0.0] - 2019-08-29
18+
19+
### Added
20+
- Dependabot.
21+
22+
### Removed
23+
- CLI support. See [secure-rm-cli](https://www.npmjs.com/package/secure-rm-cli)
24+
- Unused packages.
25+
1726
## [2.0.1] - 2019-08-27
1827

1928
### Added

README.md

+27-65
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,7 @@ To install this package, just run: (Node and npm required)
3333
npm install secure-rm
3434
```
3535

36-
Or the _command-line version_: **🚨 Deprecated 🚨**
37-
38-
```shell
39-
npm install secure-rm -g
40-
```
41-
42-
Move over `secure-rm-cli`:
43-
44-
```shell
45-
npm install secure-rm-cli -g
46-
```
47-
36+
Looking for a **command line interface**? See: [secure-rm-cli](https://www.npmjs.com/package/secure-rm-cli)
4837

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

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

76-
### Command line version **🚨 Deprecated 🚨**
77-
**(soon deprecated, will be ported to secure-rm-cli)**
78-
79-
If you want to delete files on the fly, just use the command line tool:
80-
```shell
81-
secure-rm ./folder/*.js
82-
```
83-
8465
## 📚 Usage
8566

8667
**`rm(path[, options] [, callback])`**
@@ -148,56 +129,37 @@ srm.event.on('warn', (file, err) => console.log('Warning ' + err + file))
148129
srm.event.on('error', (file, err) => console.log('Error ' + err + file))
149130
```
150131
151-
### Command line tool **🚨 Deprecated 🚨**
152-
```shell
153-
secure-rm <PATHS> [OPTIONS]
132+
### The `srm` Object
133+
134+
When you import the library, you can do this in two different ways:
135+
```javascript
136+
const srm = require('secure-rm')
154137
```
155-
- `PATHS`:
156-
- one or multiple paths (e.g. `D:\data /d/data ./data/file.js ../../data`)
157-
- supports [glob patterns](https://www.npmjs.com/package/glob#glob-primer) (e.g. `./*.js ./**/* @(pattern|pat*|pat?erN)`)
158-
- `OPTIONS` (flags):
159-
- `-f, --force`: avoid checks if you want to use it in a shell or bash file;
160-
- `-h, --help`: show CLI help, see below;
161-
- `-s, --standard`: numerical ID of the standard, default is 0. See them detailed below;
162-
- `-r, --retries`: max retries if an error occur;
163-
- `-t, --table `: show the standards table. See them detailed below;
164-
- `-v, --version `: show CLI version;
165-
- `--no-globbing `: disable file globbing.
166-
167-
Example:
168-
```shell
169-
secure-rm ./folder/*.js ./file.js -s gutmann -f
138+
And then get the properties:
139+
```javascript
140+
srm.event
141+
srm.write
142+
srm.validIDs
143+
...
144+
```
145+
Or you can import each property:
146+
```javascript
147+
import srm, { event, write, standard, validIDs, UnlinkStandard } from 'secure-rm'
148+
// Or
149+
const { event, write, standards, validIDs, UnlinkStandard } = require('secure-rm')
170150
```
171-
You can invoke the built-in help with `secure-rm -h`:
172151
173-
<!--AUTO GENERATED HELP START-->
174-
```shell
175-
CLI help:
176-
177-
USAGE
178-
$ secure-rm PATH
179-
180-
OPTIONS
181-
-f, --force avoid checks
182-
-h, --help show CLI help
183-
-m, --mute mutes the cli to the bare minimum
184-
-r, --retries=retries [default: 3] max retries if error
185-
-s, --standard=standard [default: secure] select the erasure standard
186-
-t, --table show the standards table
187-
-v, --version show CLI version
188-
--[no-]globbing allow or not file globbing
189-
190-
DESCRIPTION
191-
Completely erases files by making recovery impossible.
192-
For extra documentation, go to https://www.npmjs.com/package/secure-rm
152+
It is structured as follows:
193153
194-
EXAMPLES
195-
$ secure-rm ./folder/*.js ./file.js -s gutmann -f
196-
$ secure-rm /d/code -m
197-
```
198-
<!--AUTO GENERATED HELP END-->
154+
`srm` [\<Function\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) :
155+
The main function, as described [above](#-usage).
156+
- `event` [\<events.EventEmitter\>](https://nodejs.org/dist/latest-v12.x/docs/api/events.html) : event object to follow the process, as described [above](#-events);
157+
- `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);
158+
- `standard` [Object\<UnlinkStandard\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) : the object containing the standards;
159+
- `validIDs` [Array\<String\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) : array containing valid text IDs of standards;
160+
- `UnlinkStandard` [\<UnlinkStandard\>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) : the class to create new standards.
199161
200-
### Standards
162+
## Standards
201163
202164
ID | Name | Passes | Description
203165
-- | ---- | ------ | -----------

assets/built-in_help.png

-11.6 KB
Binary file not shown.

bin/run

-4
This file was deleted.

bin/run-dev

-4
This file was deleted.

bin/run-dev.cmd

-3
This file was deleted.

bin/run.cmd

-3
This file was deleted.

package.json

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
{
22
"name": "secure-rm",
3-
"version": "2.0.1",
3+
"version": "3.0.0",
44
"description": "Completely erases files by making recovery impossible.",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
77
"scripts": {
8-
"start": "node bin/run",
9-
"start-dev": "node bin/run-dev",
108
"build": "npm run build-ts && npm run lint",
119
"build-ts": "tsc",
1210
"watch-ts": "tsc -w",
@@ -17,18 +15,11 @@
1715
"style": "standard --verbose --env jest"
1816
},
1917
"dependencies": {
20-
"@oclif/command": "^1.5.18",
21-
"@oclif/parser": "^3.8.4",
22-
"@types/rimraf": "^2.0.2",
23-
"chalk": "^2.4.2",
24-
"glob": "^7.1.4",
25-
"inquirer": "^6.5.2",
26-
"ololog": "^1.1.146",
27-
"rimraf": "^2.6.3",
28-
"tslib": "^1.10.0",
29-
"tty-table": "^2.7.3"
18+
"rimraf": "^3.0.0",
19+
"tslib": "^1.10.0"
3020
},
3121
"devDependencies": {
22+
"@types/rimraf": "^2.0.2",
3223
"@types/jest": "^24.0.18",
3324
"coveralls": "^3.0.6",
3425
"jest": "^24.8.0",
@@ -48,15 +39,6 @@
4839
"engines": {
4940
"node": ">=8.0.0"
5041
},
51-
"oclif": {
52-
"bin": "secure-rm"
53-
},
54-
"np": {
55-
"yarn": false
56-
},
57-
"bin": {
58-
"secure-rm": "./bin/run"
59-
},
6042
"files": [
6143
"/dist",
6244
"/bin"

src/cli/check.ts

-84
This file was deleted.

src/cli/deprecated.ts

-24
This file was deleted.

0 commit comments

Comments
 (0)