Skip to content

Commit a5bab89

Browse files
committed
Updates README.md
1 parent ea85c6b commit a5bab89

File tree

2 files changed

+46
-15
lines changed

2 files changed

+46
-15
lines changed

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,34 @@ These events are listed in the table above and were previously mentioned.
123123
| RESULTS_APPENDED | Results added to scan report file |
124124

125125

126-
### Dependency Scanning
127-
```typescript
128-
import { DependencyScanner, DependencyScannerCfg } from "scanoss";
129126

130-
const main = async () => {
131127

132-
const dependencyScanner = new DependencyScanner();
128+
## Local Development and Usage
129+
If you want to develop this package and use it locally in your project (without publishing it), follow these steps:
130+
131+
#### 1 - Creating a Symbolic Link for the Development Package:
132+
In the root of the scanoss.js package, run the command:
133+
134+
```bash
135+
npm install && npm run build && npm link .
136+
```
137+
This command creates a global symbolic link in your system that points to the local location of your package. This means you can use the package in any other Node.js project on your machine as if it were installed globally.
133138

134-
//Scan a full folder
135-
const results = await dependencyScanner.scanFolder("./node_modules")
139+
#### 2 - Using the Package in Your Project:
140+
141+
In the root of the project where you want to use the scanoss package, run the command:
142+
143+
```bash
144+
npm link scanoss
145+
```
146+
This will create a symbolic link in your project to the globally linked scanoss package. Any changes made in the package will be immediately reflected in the consuming project.
136147

137-
//Scan specific files
138-
//const results = await dependencyScanner.scan(["./package.json", "package-lock.json"])
148+
#### 3 - Disconnecting the Link:
139149

140-
}
150+
Remember that once you finish developing or using the package locally, you should break the link to avoid potential issues with future versions or with installing other packages. To do this, simply run:
141151

142-
main();
152+
```bash
153+
npm unlink scanoss
143154
```
144-
# Build and test the module
155+
in both the project and the scanoss package. This will remove the symbolic links and restore the normal state of the packages.
145156

146-
- `npm install` will install the dependencies.
147-
- `npm run build` will build the module.
148-
- `npm run test` will publish the module.

src/sdk/Services/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,26 @@ async function main() {
9999

100100
main();
101101
```
102+
103+
### Dependency Scanning
104+
105+
```typescript
106+
import {
107+
DependencyScanner,
108+
DependencyScannerCfg
109+
} from "scanoss";
110+
111+
const main = async () => {
112+
113+
const dependencyScanner = new DependencyScanner();
114+
115+
//Scan a full folder
116+
const results = await dependencyScanner.scanFolder("./node_modules")
117+
118+
//Scan specific files
119+
//const results = await dependencyScanner.scan(["./package.json", "package-lock.json"])
120+
121+
}
122+
123+
main();
124+
```

0 commit comments

Comments
 (0)