Skip to content

Commit f7b59ed

Browse files
committed
Swap out npm.com urls with socket.dev urls
1 parent 46adda7 commit f7b59ed

File tree

5 files changed

+60
-28
lines changed

5 files changed

+60
-28
lines changed

README.md

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Socket CLI
22

33
[![Socket Badge](https://socket.dev/api/badge/npm/package/@socketsecurity/cli)](https://socket.dev/npm/package/@socketsecurity/cli)
4-
[![npm version](https://img.shields.io/npm/v/@socketsecurity/cli.svg?style=flat)](https://www.npmjs.com/package/@socketsecurity/cli)
4+
[![npm version](https://img.shields.io/npm/v/@socketsecurity/cli.svg?style=flat)](https://socket.dev/npm/package/@socketsecurity/cli)
55
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/SocketDev/eslint-config)
66
[![Follow @SocketSecurity](https://img.shields.io/twitter/follow/SocketSecurity?style=social)](https://twitter.com/SocketSecurity)
77

@@ -25,53 +25,79 @@ socket wrapper --enable
2525

2626
- `socket info <package@version>` - looks up issues for a package
2727

28-
- `socket report create <path(s)-to-folder-or-file>` - creates a report on [socket.dev](https://socket.dev/)
28+
- `socket report create <path(s)-to-folder-or-file>` - creates a report on
29+
[socket.dev](https://socket.dev/)
2930

30-
Uploads the specified `package.json` and lock files for JavaScript, Python, and Go dependency manifests.
31-
If any folder is specified, the ones found in there recursively are uploaded.
31+
Uploads the specified `package.json` and lock files for JavaScript, Python,
32+
and Go dependency manifests. If any folder is specified, the ones found in
33+
there recursively are uploaded.
3234

33-
Supports globbing such as `**/package.json`, `**/requirements.txt`, `**/pyproject.toml`, and `**/go.mod`.
35+
Supports globbing such as `**/package.json`, `**/requirements.txt`,
36+
`**/pyproject.toml`, and `**/go.mod`.
3437

35-
Ignores any file specified in your project's `.gitignore`, the `projectIgnorePaths` in your project's [`socket.yml`](https://docs.socket.dev/docs/socket-yml) and on top of that has a sensible set of [default ignores](https://www.npmjs.com/package/ignore-by-default)
38+
Ignores any file specified in your project's `.gitignore`, the
39+
`projectIgnorePaths` in your project's
40+
[`socket.yml`](https://docs.socket.dev/docs/socket-yml) and on top of that has
41+
a sensible set of
42+
[default ignores](https://socket.dev/npm/package/ignore-by-default)
3643

3744
- `socket report view <report-id>` - looks up issues and scores from a report
3845

39-
- `socket wrapper --enable` and `socket wrapper --disable` - Enables and disables the Socket 'safe-npm' wrapper.
46+
- `socket wrapper --enable` and `socket wrapper --disable` - Enables and
47+
disables the Socket 'safe-npm' wrapper.
4048

41-
- `socket raw-npm` and `socket raw-npx` - Temporarily disables the Socket 'safe-npm' wrapper.
49+
- `socket raw-npm` and `socket raw-npx` - Temporarily disables the Socket
50+
'safe-npm' wrapper.
4251

4352
## Aliases
4453

4554
All aliases supports flags and arguments of the commands they alias.
4655

47-
- `socket ci` - alias for `socket report create --view --strict` which creates a report and quits with an exit code if the result is unhealthy. Use like eg. `socket ci .` for a report for the current folder
56+
- `socket ci` - alias for `socket report create --view --strict` which creates a
57+
report and quits with an exit code if the result is unhealthy. Use like eg.
58+
`socket ci .` for a report for the current folder
4859

4960
## Flags
5061

5162
### Command specific flags
5263

53-
- `--view` - when set on `socket report create` the command will immediately do a `socket report view` style view of the created report, waiting for the server to complete it
64+
- `--view` - when set on `socket report create` the command will immediately do
65+
a `socket report view` style view of the created report, waiting for the
66+
server to complete it
5467

5568
### Output flags
5669

57-
- `--json` - outputs result as json which you can then pipe into [`jq`](https://stedolan.github.io/jq/) and other tools
58-
- `--markdown` - outputs result as markdown which you can then copy into an issue, PR or even chat
70+
- `--json` - outputs result as json which you can then pipe into
71+
[`jq`](https://stedolan.github.io/jq/) and other tools
72+
- `--markdown` - outputs result as markdown which you can then copy into an
73+
issue, PR or even chat
5974

6075
## Strictness flags
6176

62-
- `--all` - by default only `high` and `critical` issues are included, by setting this flag all issues will be included
63-
- `--strict` - when set, exits with an error code if report result is deemed unhealthy
77+
- `--all` - by default only `high` and `critical` issues are included, by
78+
setting this flag all issues will be included
79+
- `--strict` - when set, exits with an error code if report result is deemed
80+
unhealthy
6481

6582
### Other flags
6683

67-
- `--dry-run` - like all CLI tools that perform an action should have, we have a dry run flag. Eg. `socket report create` supports running the command without actually uploading anything
68-
- `--debug` - outputs additional debug output. Great for debugging, geeks and us who develop. Hopefully you will never _need_ it, but it can still be fun, right?
69-
- `--help` - prints the help for the current command. All CLI tools should have this flag
70-
- `--version` - prints the version of the tool. All CLI tools should have this flag
84+
- `--dry-run` - like all CLI tools that perform an action should have, we have a
85+
dry run flag. Eg. `socket report create` supports running the command without
86+
actually uploading anything
87+
- `--debug` - outputs additional debug output. Great for debugging, geeks and us
88+
who develop. Hopefully you will never _need_ it, but it can still be fun,
89+
right?
90+
- `--help` - prints the help for the current command. All CLI tools should have
91+
this flag
92+
- `--version` - prints the version of the tool. All CLI tools should have this
93+
flag
7194

7295
## Configuration files
7396

74-
The CLI reads and uses data from a [`socket.yml` file](https://docs.socket.dev/docs/socket-yml) in the folder you run it in. It supports the version 2 of the `socket.yml` file format and makes use of the `projectIgnorePaths` to excludes files when creating a report.
97+
The CLI reads and uses data from a
98+
[`socket.yml` file](https://docs.socket.dev/docs/socket-yml) in the folder you
99+
run it in. It supports the version 2 of the `socket.yml` file format and makes
100+
use of the `projectIgnorePaths` to excludes files when creating a report.
75101

76102
## Environment variables
77103

@@ -81,15 +107,21 @@ The CLI reads and uses data from a [`socket.yml` file](https://docs.socket.dev/d
81107

82108
### Environment variables for development
83109

84-
- `SOCKET_SECURITY_API_BASE_URL` - if set, this will be the base for all API-calls. Defaults to `https://api.socket.dev/v0/`
85-
- `SOCKET_SECURITY_API_PROXY` - if set to something like [`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries), then all request will be proxied through that proxy
110+
- `SOCKET_SECURITY_API_BASE_URL` - if set, this will be the base for all
111+
API-calls. Defaults to `https://api.socket.dev/v0/`
112+
- `SOCKET_SECURITY_API_PROXY` - if set to something like
113+
[`http://127.0.0.1:9090`](https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries),
114+
then all request will be proxied through that proxy
86115

87116
## Similar projects
88117

89-
- [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js) - the SDK used in this CLI
118+
- [`@socketsecurity/sdk`](https://github.com/SocketDev/socket-sdk-js) - the SDK
119+
used in this CLI
90120

91121
## See also
92122

93123
- [Announcement blog post](https://socket.dev/blog/announcing-socket-cli-preview)
94-
- [Socket API Reference](https://docs.socket.dev/reference) - the API used in this CLI
95-
- [Socket GitHub App](https://github.com/apps/socket-security) - the plug-and-play GitHub App
124+
- [Socket API Reference](https://docs.socket.dev/reference) - the API used in
125+
this CLI
126+
- [Socket GitHub App](https://github.com/apps/socket-security) - the
127+
plug-and-play GitHub App

scripts/utils/regexps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
// Inlined "escape-string-regexp":
4-
// https://www.npmjs.com/package/escape-string-regexp/v/5.0.0
4+
// https://socket.dev/npm/package/escape-string-regexp/overview/5.0.0
55
// MIT License
66
// Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
77
function escapeRegExp(str) {

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function camelToHyphen(str: string): string {
2727
return str.replace(/[A-Z]+/g, '-$&').toLowerCase()
2828
}
2929

30-
// TODO: Add autocompletion using https://www.npmjs.com/package/omelette
30+
// TODO: Add autocompletion using https://socket.dev/npm/package/omelette
3131
void (async () => {
3232
try {
3333
updateNotifier({

src/utils/regexps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Inlined "escape-string-regexp":
2-
// https://www.npmjs.com/package/escape-string-regexp/v/5.0.0
2+
// https://socket.dev/npm/package/escape-string-regexp/overview/5.0.0
33
// MIT License
44
// Copyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)
55
export function escapeRegExp(string: string): string {

src/utils/strings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Inspired by "balanced-match":
2-
// https://www.npmjs.com/package/balanced-match/v/3.0.1
2+
// https://socket.dev/npm/package/balanced-match/overview/3.0.1
33
// MIT License
44
// Copyright (c) 2013 Julian Gruber <[email protected]>
55
export function isBalanced(

0 commit comments

Comments
 (0)