Skip to content

Commit e5d1b7b

Browse files
authored
update readme with example of removing functions
1 parent a572acd commit e5d1b7b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,23 @@ cd ../..
106106
./transform.sh Playground/serve-static "static"
107107
```
108108

109+
#### Remove Functions in `serve-static`
110+
111+
Stubbifier also supports a `--removeFuns <>` option, allowing users to specify a set of functions that should be totally removed from an application.
112+
The format of the file should match the format of the static callgraph; thus, we illustrate this functionality with `serve-static` using the static CG:
113+
114+
```
115+
./resetProject.sh Playground/serve-static
116+
117+
# If you haven't already: ./genStaticCG.sh Playground/serve-static serve-static
118+
119+
#
120+
./remove.sh Playground/serve-static "static"
121+
```
122+
123+
This should (1) remove all functions detected with the static call graph, and stub the rest.
124+
If you look at, e.g., index.js (`vim Playground/serve-static/index.js`), you should see a mix of removed functions and stubbed functions.
125+
109126
### Integration with bundlers
110127
We also support integration with `rollup`, a popular JavaScript bundler.
111128
`bundler_mode` is another mode of `stubbifier` execution, with options:

0 commit comments

Comments
 (0)