0.10.0 • Published 9 months ago
tachyon-drive-node-fs v0.10.0
tachyon-drive-node-fs
NodeFS File Storage Driver for Tachyon Drive and Tachyon Drive Crypto processor
Initialize simple JSON file storage driver
const driver = new FileStorageDriver('FileStorageDriver', './store.json', bufferSerializer);
Initialize crypt processor with JSON file storage driver
const processor = new CryptoBufferProcessor(Buffer.from('some-secret-key'));
const driver = new FileStorageDriver('FileStorageDriver', './store.json.aes', bufferSerializer, processor);
Example usage of local notification file updates when running multiple process on same host
const fileUpdateNotify = new FileUpdateNotify('./store.notify');
const driver = new SomeDriver('SomeDriverWithoutUpdateNotification', bufferSerializer, fileUpdateNotify);
// includes common strToBufferSerializer
const jsonSerialization: IPersistSerializer<Data, string> = {
deserialize: (buffer: string) => JSON.parse(buffer.toString()),
serialize: (data: Data) => JSON.stringify(data),
validator: (data: Data) => dataSchema.safeParse(data).success,
};
const bufferSerializer: IPersistSerializer<Data, Buffer> = nextSerializer<Data, string, Buffer>(jsonSerialization, strToBufferSerializer);
see more on NPMJS tachyon-drive
0.10.0
9 months ago
0.9.0
10 months ago
0.8.0
1 year ago
0.7.0
1 year ago
0.6.0
1 year ago
0.5.0
1 year ago
0.5.1
1 year ago
0.3.2
1 year ago
0.1.0
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.1
2 years ago
0.3.1
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago