You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams.
13
13
14
+
14
15
*[Data Loss Prevention (DLP) API Node.js Client API Reference][client-docs]
Copy file name to clipboardExpand all lines: packages/google-privacy-dlp/samples/README.md
+49-25
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Google Cloud Data Loss Prevention (DLP) API: Node.js Samples
4
4
5
-
[]()
5
+
[![Open in Cloud Shell][shell_img]][shell_link]
6
6
7
7
The [Data Loss Prevention API](https://cloud.google.com/dlp/docs/) provides programmatic access to a powerful detection engine for personally identifiable information and other privacy-sensitive data in unstructured data streams.
8
8
@@ -28,28 +28,33 @@ library's README.
28
28
29
29
View the [source code][inspect_0_code].
30
30
31
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/inspect.js,samples/README.md)
32
+
31
33
__Usage:__`node inspect.js --help`
32
34
33
35
```
36
+
inspect.js <command>
37
+
34
38
Commands:
35
-
string <string> Inspect a string using the Data Loss Prevention API.
36
-
file <filepath> Inspects a local text, PNG, or JPEG file using the Data Loss Prevention API.
37
-
gcsFilePromise <bucketName> <fileName> Inspects a text file stored on Google Cloud Storage using the Data Loss
38
-
Prevention API and the promise pattern.
39
-
gcsFileEvent <bucketName> <fileName> Inspects a text file stored on Google Cloud Storage using the Data Loss
40
-
Prevention API and the event-handler pattern.
41
-
bigquery <datasetName> <tableName> Inspects a BigQuery table using the Data Loss Prevention API.
42
-
datastore <kind> Inspect a Datastore instance using the Data Loss Prevention API.
39
+
inspect.js string <string> Inspect a string using the Data Loss Prevention API.
40
+
inspect.js file <filepath> Inspects a local text, PNG, or JPEG file using the Data Loss
41
+
Prevention API.
42
+
inspect.js gcsFilePromise <bucketName> <fileName> Inspects a text file stored on Google Cloud Storage using the Data
43
+
Loss Prevention API and the promise pattern.
44
+
inspect.js gcsFileEvent <bucketName> <fileName> Inspects a text file stored on Google Cloud Storage using the Data
45
+
Loss Prevention API and the event-handler pattern.
46
+
inspect.js bigquery <datasetName> <tableName> Inspects a BigQuery table using the Data Loss Prevention API.
47
+
inspect.js datastore <kind> Inspect a Datastore instance using the Data Loss Prevention API.
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/redact.js,samples/README.md)
79
+
73
80
__Usage:__`node redact.js --help`
74
81
75
82
```
83
+
redact.js <command>
84
+
76
85
Commands:
77
-
string <string> <replaceString> Redact sensitive data from a string using the Data Loss Prevention API.
78
-
image <filepath> <outputPath> Redact sensitive data from an image using the Data Loss Prevention API.
86
+
redact.js string <string> <replaceString> Redact sensitive data from a string using the Data Loss Prevention API.
87
+
redact.js image <filepath> <outputPath> Redact sensitive data from an image using the Data Loss Prevention API.
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/metadata.js,samples/README.md)
113
+
103
114
__Usage:__`node metadata.js --help`
104
115
105
116
```
117
+
metadata.js <command>
118
+
106
119
Commands:
107
-
infoTypes <category> List types of sensitive information within a category.
108
-
categories List root categories of sensitive information.
120
+
metadata.js infoTypes <category> List types of sensitive information within a category.
121
+
metadata.js categories List root categories of sensitive information.
109
122
110
123
Options:
111
124
--version Show version number [boolean]
112
-
--help Show help [boolean]
113
125
-l, --languageCode [string] [default: "en-US"]
126
+
--help Show help [boolean]
114
127
115
128
Examples:
116
129
node metadata.js infoTypes GOVERNMENT
@@ -126,12 +139,16 @@ For more information, see https://cloud.google.com/dlp/docs
126
139
127
140
View the [source code][deid_3_code].
128
141
142
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/deid.js,samples/README.md)
143
+
129
144
__Usage:__`node deid.js --help`
130
145
131
146
```
147
+
deid.js <command>
148
+
132
149
Commands:
133
-
mask <string> Deidentify sensitive data by masking it with a character.
134
-
fpe <string> <wrappedKey> <keyName> Deidentify sensitive data using Format Preserving Encryption (FPE).
150
+
deid.js mask <string> Deidentify sensitive data by masking it with a character.
151
+
deid.js fpe <string> <wrappedKey> <keyName> Deidentify sensitive data using Format Preserving Encryption (FPE).
135
152
136
153
Options:
137
154
--version Show version number [boolean]
@@ -151,23 +168,27 @@ For more information, see https://cloud.google.com/dlp/docs.
151
168
152
169
View the [source code][risk_4_code].
153
170
171
+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-dlp&page=editor&open_in_editor=samples/risk.js,samples/README.md)
172
+
154
173
__Usage:__`node risk.js --help`
155
174
156
175
```
176
+
risk.js <command>
177
+
157
178
Commands:
158
-
numerical <datasetId> <tableId> <columnName> Computes risk metrics of a column of numbers in a Google
159
-
BigQuery table.
160
-
categorical <datasetId> <tableId> <columnName> Computes risk metrics of a column of data in a Google
179
+
risk.js numerical <datasetId> <tableId> <columnName> Computes risk metrics of a column of numbers in a Google
161
180
BigQuery table.
162
-
kAnonymity <datasetId> <tableId> [quasiIdColumnNames..] Computes the k-anonymity of a column set in a Google
181
+
risk.js categorical <datasetId> <tableId> <columnName>Computes risk metrics of a column of data in a Google
163
182
BigQuery table.
164
-
lDiversity <datasetId> <tableId> <sensitiveAttribute> Computes the l-diversity of a column set in a Google
183
+
risk.js kAnonymity <datasetId> <tableId> Computes the k-anonymity of a column set in a Google
165
184
[quasiIdColumnNames..] BigQuery table.
185
+
risk.js lDiversity <datasetId> <tableId> Computes the l-diversity of a column set in a Google
0 commit comments