7
7
<br />
8
8
9
9
<div align =" center " >
10
-
10
+
11
11
[ ![ Build Status] ( https://travis-ci.org/NickNaso/hertzy.svg?branch=master )] ( https://travis-ci.org/NickNaso/hertzy )
12
12
[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/twdommvefkpw70dp/branch/master?svg=true )] ( https://ci.appveyor.com/project/NickNaso/hertzy/branch/master )
13
13
[ ![ NPM version] ( https://img.shields.io/npm/v/hertzy.svg?style=flat )] ( https://www.npmjs.com/package/hertzy )
21
21
* [ Motivations] ( #motivations )
22
22
* [ Installation] ( #install )
23
23
* [ Usage] ( #usage )
24
+ * [ Hertzy for browsers] ( #hertzy_for_browsers )
24
25
* [ API documentation] ( #api )
25
26
* [ Code of conduct] ( CODE_OF_CONDUCT.md )
26
27
* [ Team] ( #team )
@@ -114,7 +115,6 @@ need to obtain a frequency or create a new one. A **frequency** object is a
114
115
channel where you can emit or listen for an event issued by other modules.
115
116
116
117
``` js
117
-
118
118
' use strict'
119
119
120
120
const Hertzy = require (' hertzy' )
@@ -135,26 +135,29 @@ usr.emit('user:add', {
135
135
password: ' ********' ,
136
136
137
137
})
138
-
139
138
```
140
139
140
+ <a name =" hertzy_for_browsers " ></a >
141
+
142
+ ## Hertzy for browsers
143
+
144
+ To use Hertzy in the browser, please refer to this specific [ version] ( https://github.com/NickNaso/hertzy/tree/browser ) .
145
+
141
146
<a name =" api " ></a >
142
147
143
148
## API
144
149
145
- ## VERSION
150
+ ### VERSION
146
151
147
152
This is a String property that represents the version of ** hertzy**
148
153
149
154
``` js
150
-
151
155
' use strict'
152
156
153
157
const Hertzy = require (' hertzy' )
154
158
155
159
// Get hertzy version and print it
156
160
console .log (Hertzy .VERSION )
157
-
158
161
```
159
162
160
163
### WARNING
@@ -168,15 +171,13 @@ hertzy, the number of max listeners will be dynamically updated based on your
168
171
usage.
169
172
170
173
``` js
171
-
172
174
' use strict'
173
175
174
176
const Hertzy = require (' hertzy' )
175
177
176
178
// Set hertzy warning value
177
179
// Get hertzy warning value and print it
178
180
console .log (Hertzy .WARNING = true )
179
-
180
181
```
181
182
182
183
### tune (frequency)
@@ -188,14 +189,12 @@ parameter **frequency** is a valid String and creates or returns an instance of
188
189
methods.
189
190
190
191
``` js
191
-
192
192
' use strict'
193
193
194
194
const Hertzy = require (' hertzy' )
195
195
196
196
// Get frequency to use
197
197
const frequency = Hertzy .tune (' user' )
198
-
199
198
```
200
199
201
200
#### How to use ** Frequency**
@@ -209,7 +208,6 @@ object.
209
208
The ** fq** method returns the string representing the frequency's name
210
209
211
210
``` js
212
-
213
211
' use strict'
214
212
215
213
const Hertzy = require (' hertzy' )
@@ -219,7 +217,6 @@ const frequency = Hertzy.tune('user')
219
217
220
218
console .log (frequency .fq ())
221
219
// It prints the String 'user'
222
-
223
220
```
224
221
225
222
#### emit(evt, [ , ...args] )
@@ -231,7 +228,6 @@ passed to the listeners of the specified event.
231
228
Remember, ** evt** needs to be a valid String otherwise you will get an error.
232
229
233
230
``` js
234
-
235
231
' use strict'
236
232
237
233
const Hertzy = require (' hertzy' )
@@ -245,7 +241,6 @@ frequency.emit('user:add', {
245
241
password: ' ********' ,
246
242
247
243
})
248
-
249
244
```
250
245
251
246
#### on (evt, fn)
@@ -258,7 +253,6 @@ Remember, **evt** and **fn** need to be a valid String and Function
258
253
respectively, otherwise you will get an error.
259
254
260
255
``` js
261
-
262
256
' use strict'
263
257
264
258
const Hertzy = require (' hertzy' )
@@ -270,7 +264,6 @@ const frequency = Hertzy.tune('user')
270
264
frequency .on (' user:add' , function (data ) {
271
265
// DO SOMETHING ...
272
266
})
273
-
274
267
```
275
268
276
269
#### off (evt, fn)
@@ -283,7 +276,6 @@ Remember, **evt** and **fn** need to be a valid String and Function
283
276
respectively, otherwise you will get an error.
284
277
285
278
``` js
286
-
287
279
' use strict'
288
280
289
281
const Hertzy = require (' hertzy' )
@@ -300,8 +292,8 @@ frequency.on('user:add', handler)
300
292
301
293
// Remove listener for 'user:add' event on 'user' frequency
302
294
frequency .off (' user:add' , handler)
303
-
304
295
```
296
+
305
297
<a name =" references_and_articles " ></a >
306
298
307
299
## Rererences and articles
0 commit comments