]> git.r.bdr.sh - rbdr/serpentity/blobdiff - lib/serpentity/node_collection.js
Rewrite using modules
[rbdr/serpentity] / lib / serpentity / node_collection.js
index c603d6fd1c02f2748e38bcfac8e3a8e391e85a40..e6150201afb82ced47171ae8af76daf1709f3b8f 100644 (file)
@@ -1,6 +1,4 @@
-'use strict';
-
-const Events = require('events');
+import Events from 'events';
 
 /*
  * Node Collections contain nodes, in order to keep the lists of nodes
@@ -10,7 +8,7 @@ const Events = require('events');
  * instances of that class.
  */
 
-const NodeCollection = class NodeCollection extends Events {
+export class NodeCollection extends Events {
 
   constructor(config) {
 
@@ -93,7 +91,7 @@ const NodeCollection = class NodeCollection extends Events {
 
     return found;
   }
-};
+}
 
 
 /*
@@ -103,5 +101,3 @@ NodeCollection.prototype[Symbol.iterator] = function * () {
 
   yield* this.nodes;
 };
-
-module.exports = NodeCollection;