How to use fswin - 6 common examples

To help you get started, we’ve selected a few fswin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stevenvachon / winattr / lib / binding / index.js View on Github external
const get = (path, callback) =>
{
	fswin.getAttributes(path, result =>
	{
		if (result === null)
		{
			// fswin does not return an error -- problem could be ENOENT,EPERM,etc
			callback( new Error("unknown error") );
			return;
		}

		let attrs = {};

		for (let i in result)
		{
			if (i.startsWith("IS_"))
			{
				attrs[i] = result[i];
			}
github stevenvachon / winattr / lib / binding / index.js View on Github external
const setSync = (path, attrs) =>
{
	const success = fswin.setAttributesSync( path, convertAttrs.to(attrs) );

	if (success === false)
	{
		// fswin does not return an error -- problem could be ENOENT,EPERM,etc
		throw new Error("unknown erorr");
	}
};
github stevenvachon / winattr / lib / binding / index.js View on Github external
const getSync = path =>
{
	const result = fswin.getAttributesSync(path);

	if (result === null)
	{
		// fswin does not return an error -- problem could be ENOENT,EPERM,etc
		throw new Error("unknown erorr");
	}

	return convertAttrs.from(result);
};
github stevenvachon / winattr / lib / binding / index.js View on Github external
const set = (path, attrs, callback) =>
{
	fswin.setAttributes(path, convertAttrs.to(attrs), success =>
	{
		// fswin does not return an error -- problem could be ENOENT,EPERM,etc
		callback( success===true ? null : new Error("unknown error") );
	});
};
github matthew-matvei / freeman / src / common / managers / AttributesManager.ts View on Github external
return new Promise((resolve, reject) => {
            fswin.getAttributes(pathToItem, result => {
                if (!result) {
                    reject(`Could not retrieve attributes for ${pathToItem}`);
                }

                const attributes: IAttributes = {
                    hidden: result!.IS_HIDDEN
                };

                resolve(attributes);
            });
        });
    }
github davej / john / lib / win32.js View on Github external
deps.map(dep =>
      fswin.setAttributesSync(dep.path, {IS_HIDDEN: hidden}) ?
        Promise.resolve(Object.assign(dep, {hidden})) :
        Promise.reject(new Error(`Failed to modify dir attr: ${dep.path}`))
    )

fswin

nodejs fs extensions for windows

MIT
Latest version published 4 months ago

Package Health Score

69 / 100
Full package analysis