Skip to content

paulshryock/node-abstractions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,173 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abstractions

⚠️ This project is in early development and not for production use.

Facade abstractions for software side-effects. Reduce accidental complexity; focus on the problem to solve.

Latest version npm bundle size npm downloads Socket License

import { LocalFileSystem, VirtualFileSystem } from '@paulshryock/abstractions'

class MyClass {
    public constructor(private fs: VirtualFileSystem) {}

    public doSomething(): void {
        this.fs.copy('some-file', 'another-file')
    }
}

new MyClass(new LocalFileSystem()).doSomething()

Why

Decouple side-effects from your business logic. Swap your infrastructure any time.

  • Switch from LocalFileSystem to SshFileSystem to S3FileSystem.
  • Switch from InMemoryStorage to FileSystemStorage to SqliteStorage.

Features

Installation

npm install @paulshryock/abstractions

Documentation

Support

Contributing

Contributions are welcome! Read the contribution guidelines, and then submit a pull request.

Maintainers

License

MIT License

About

Library of Node.js abstractions for side effects at the edges of software.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors