Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ngxs-electron-storage
Advanced tools
NGXS storage plugin for Electron, that helps you to persist your store data in files.
This @NGXS storage plugin helps you to persist your store data in files.
It will persist any changes in your store automatically. It does check for changes and allows debouncing of file writing (see Usage).
More on how storage plugins work: Storage - ngxs.gitbooks.io
npm i ngxs-electron-storage
@NgModule({
imports: [
NgxsModule.forRoot(states),
NgxsElectronStorageModule.forRoot(),
NgxsStoragePluginModule.forRoot()
],
providers: [
{
provide: STORAGE_ENGINE,
useClass: ElectronStorageEngine
}
]
})
You can pass a configuration object in the forRoot
method.
interface ElectronStorageOptions {
fileExtension?: string; // the file extension
location?: string; // the location to store the files
debounce?: number; // you can debounce the IO process of writing the file (in milliseconds)
}
{
debounce: 0,
location: "~",
fileExtension: "json"
}
If your given location
starts with a ~
it will be replaced by the userData
folder from electron:
(electron.app || electron.remote.app).getPath('userData');
So you can write { location: "~/data"}
to store your files in %AppData%\Roaming\your-app\data
.
The plugin will ensure that the location
exists once at the start and creates the directory if necessary.
ElectronStorageService
You can inject a ElectronStorageService
in your components to have access to the store objects, which represent your files.
Each store object exposes a persistNotifications$
observable, which emits notifications with the store name and the serialized state.
The service itself also exposes a persistNotifications$
observable, which combines all notifications of all stores.
FAQs
NGXS storage plugin for Electron, that helps you to persist your store data in files.
The npm package ngxs-electron-storage receives a total of 0 weekly downloads. As such, ngxs-electron-storage popularity was classified as not popular.
We found that ngxs-electron-storage demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.