0.3.2 • Published 4 months ago

tachyon-drive-node-fs v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

tachyon-drive-node-fs

TypeScript npm version Maintainability Test Coverage github action

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.3.2

4 months ago

0.1.0

12 months ago

0.3.0

11 months ago

0.2.0

11 months ago

0.1.1

12 months ago

0.3.1

8 months ago

0.0.8

12 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago