Skip to content

Commit aa4f495

Browse files
committed
readme update
1 parent ba1d55e commit aa4f495

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

README.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
This package is used to parse vue script section and it provides an interface to add, update and delete entities of different life cycles hooks of VueJS.
66

7+
78

89
## Installation
10+
11+
### [NPM](https://www.npmjs.com/package/vue-script-ast-parser)
912
```
1013
npm install vue-script-ast-parser
1114
```
@@ -79,21 +82,67 @@ export default {
7982
}
8083
```
8184

85+
86+
## Imports
87+
88+
### To add new import
89+
90+
```
91+
let instance = new VueScriptParser(code)
92+
instace.addImpoort(importStatement)
93+
```
94+
95+
### To remove import from imports
96+
97+
```
98+
let instance = new VueScriptParser(code)
99+
instace.removImport(importStatement)
100+
```
101+
82102
## Data
83103

84104
### To add new variable in data
85105

86106
```
87107
let instance = new VueScriptParser(code)
88-
instace.addData('country','INDIA')
108+
instace.addData(variableName,value)
89109
```
90110

91-
#### Output
111+
### To remove variable from data
92112

93113
```
114+
let instance = new VueScriptParser(code)
115+
instace.removeData(variableName)
116+
```
117+
118+
## Mounted
119+
120+
### To add/updated in given script
94121

122+
```
123+
let instance = new VueScriptParser(code)
124+
instace.addMounted(mountedBody)
125+
```
126+
127+
## Methods
128+
129+
### To add new method in methods
130+
131+
```
132+
let instance = new VueScriptParser(code)
133+
instace.addMethod(name,body,args)
95134
```
96135

136+
### To remove method from methods
137+
138+
```
139+
let instance = new VueScriptParser(code)
140+
instace.removeMethod(methodName)
141+
```
142+
143+
144+
145+
97146

98147

99148

0 commit comments

Comments
 (0)