new NodeRAS()
Create a constructor method that calls the instance's init method.
This allows the constructor to be overridden by other modules because
they can override the init method with their own.
- Source:
Methods
- compact() → {Number}
- post(filePath, primaryKey, data, callback)
- put(filePath, primaryKey, data, callback)
compact() → {Number}
Scans the data file specified and removes entries marked for deletion,
de-fragments entries that span multiple points and then re-writes the
file.
- Source:
Returns:
The number of bytes saved by the compact process.
This is the file size in bytes before the operation minus the file size
in bytes after the operation.
- Type
- Number
post(filePath, primaryKey, data, callback)
Appends new data to the end of the file.
Parameters:
| Name | Type | Description |
|---|---|---|
filePath |
The file to operate on. | |
primaryKey |
The data entry's primary key. | |
data |
The data to write. | |
callback |
A callback after the operation has finished. |
- Source:
put(filePath, primaryKey, data, callback)
Parameters:
| Name | Type | Description |
|---|---|---|
filePath |
The file to operate on. | |
primaryKey |
The data entry's primary key. | |
data |
The data to write. | |
callback |
- Source: