@peter.naydenov/notice 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Peter Naydenov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -156,19 +156,20 @@ Enable again specified event.
156
156
 
157
157
  ```js
158
158
  let result = 0;
159
- const
160
- eBus = notice ()
161
- , fn1 = x => result += 1 + x
162
- , fn2 = x => result += 3 + x
163
- ;
164
- eBus.on ( 'go', fn1 )
165
- eBus.on ( 'go', fn2 )
166
- eBus.stop ( 'go' )
167
- eBus.emit ( 'go', 2 )
168
- // ---> result == 0
169
- eBus.start ( 'go', 2 )
170
- eBus.emit ( 'go' )
171
- // ---> result == 8
159
+ const
160
+ eBus = notice ()
161
+ , fn1 = x => result += 1 + x
162
+ , fn2 = x => result += 3 + x
163
+ ;
164
+ eBus.on ( 'go', fn1 )
165
+ eBus.on ( 'go', fn2 )
166
+ eBus.stop ( 'go' )
167
+ eBus.emit ( 'go', 2 )
168
+ // ---> result == 0
169
+ eBus.start ( 'go' )
170
+ eBus.emit ( 'go', 1 )
171
+ console.log ( result )
172
+ // ---> result == 6
172
173
  ```
173
174
 
174
175
 
@@ -189,11 +190,25 @@ eBus.emit ( 'dummy' )
189
190
  ```
190
191
 
191
192
 
193
+
194
+
195
+
192
196
  ## Release History
193
197
 
198
+
199
+
200
+ ### 2.0.0 ( 2023-06-15)
201
+ - [x] Library was converted to ES6 module;
202
+ - [x] License was changed from ISC to MIT;
203
+
204
+
205
+
194
206
  ### 1.1.0 ( 2022-10-21)
195
207
  - [x] Method 'debug' was added;
196
208
 
209
+
210
+
211
+
197
212
  ### 1.0.1 ( 2022-08-15)
198
213
  - [x] Fix: Event data is coming in Array;
199
214
  - [x] Fix: Multiple instances of notice;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@peter.naydenov/notice",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "description": "Event emmiter - NOTICE",
5
5
  "main": "src/main.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "mocha test",
8
- "cover": "nyc mocha"
9
+ "cover": "c8 mocha"
9
10
  },
10
11
  "author": "Peter Naydenov",
11
12
  "keywords": [
@@ -15,13 +16,13 @@
15
16
  "subscriber",
16
17
  "pubsub"
17
18
  ],
18
- "license": "ISC",
19
+ "license": "MIT",
19
20
  "devDependencies": {
20
- "chai": "4.3.6",
21
- "mocha": "10.0.0",
22
- "nyc": "15.1.0"
21
+ "c8": "^8.0.0",
22
+ "chai": "4.3.7",
23
+ "mocha": "10.2.0"
23
24
  },
24
- "nyc": {
25
+ "c8": {
25
26
  "include": [
26
27
  "src/**/*.js"
27
28
  ],
package/src/main.js CHANGED
@@ -93,6 +93,6 @@ function notice () {
93
93
 
94
94
 
95
95
 
96
- module.exports = notice
96
+ export default notice
97
97
 
98
98
 
package/test/01-notice.js CHANGED
@@ -1,12 +1,16 @@
1
1
  "use strict"
2
2
 
3
- const
4
- notice = require ( '../src/main' )
5
- , expect = require ( 'chai' ).expect
6
- ;
3
+ import notice from '../src/main.js'
4
+ import { expect } from 'chai'
5
+
6
+
7
+
8
+
7
9
 
8
10
  describe ( 'Testing Notice', () => {
9
11
 
12
+
13
+
10
14
  it ( 'Standard event', () => {
11
15
  const eBus = notice ();
12
16
  let result = 0;
@@ -258,6 +262,7 @@ it ( 'Multiple Notice instances', () => {
258
262
  }) // it Multiple Notice instances
259
263
 
260
264
 
265
+
261
266
  }) // define
262
267
 
263
268