3.0.2 • Published 2 years ago
fs-oop v3.0.2
Deprecated
The performance of this was too bad ( ~6x times slower ).
I created a new version which created classes at runtime instead of using asynclocalstorage
.\
The performance was good, but it required to use this
and plugins API wasn't so great. So there just was no point to continue because the core idea was to write less code in a more beautiful way.
File System OOP (fs-oop
)
Allows splitting object definition to separate files.\
Below is the example of a method written in fs-oop
style.
import { useDependencies } from 'fs-oop';
import { IDependencies } from './dependencies';
export const greet = async (): Promise<string> => {
const { greetingProvider, counter } = useDependencies<IDependencies>();
await counter.inc();
return greetingProvider.getGreeting();
};
Node version 16.4.0 and above
Based on AsyncLocaleStorage
. It is stable since Node v16.4.0 - docs\
Using with Node versions below is not recommended.