Create a restore point on your Windows machine using NodeJS.
This project provides a scriptable alternative to PowerShell for creating restore points on Windows machines, implemented in Node.js.
If you are interested in contributing, please clone the repository and have a look around. Constructive criticism is always desired, and meaningful contributions are greatly appreciated.
{
"clean": "rimraf coverage dist tsconfig.release.tsbuildinfo",
"build": "tsc -p tsconfig.release.json",
"watch": "tsc -w -p tsconfig.release.json",
"lint": "eslint .",
"format": "prettier . --write",
"pretest": "npm run lint",
"test": "npm run test-only",
"test-only": "jest --coverage",
"test:watch": "jest --watch"
}clean- Clear directories that have artifacts.build- Compile the TypeScript code.watch- Watch*.tsfiles for changes, and recompile.lint- Lint the TypeScript source.format- Format the codebase using Prettier.pretest- Lints the TypeScript source.test- Runs all unit tests.test-only- Runs all unit tests.test:watch- Watches all unit tests.
The system-restore module exports a single function called createRestorePoint. You can import it using the following example:
const { createRestorePoint } = require('system-restore');/**
* Creates a system restore point.
*
* @param restorePointName The name of the restore point.
* @param restorePointType The type of restore point to create.
*/
createRestorePoint(restorePointName: string, restorePointType: string): Promise<boolean>- APPLICATION_INSTALL
- APPLICATION_UNINSTALL
- DEVICE_DRIVER_INSTALL
- MODIFY_SETTINGS
- CANCELLED_OPERATION
You can use the CLI directly with npx:
npx system-restore --restorePointName="Hello, world!" --restorePointType=APPLICATION_INSTALL--restorePointName{String} The name of the restore point.--restorePointType{String} The type of restore point to create.
- APPLICATION_INSTALL
- APPLICATION_UNINSTALL
- DEVICE_DRIVER_INSTALL
- MODIFY_SETTINGS
- CANCELLED_OPERATION
You may need to run your scripts with Administrator privileges to get your JavaScript implementation to work. If you get an error, it's possible that you need to run the script using elevated permissions.
Please use the issue tracker to ask any questions, or to opine about something regarding the project.