Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@universal-packages/fs-utils

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@universal-packages/fs-utils - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

LICENSE.md

5

package.json
{
"name": "@universal-packages/fs-utils",
"version": "1.0.0",
"version": "1.0.1",
"description": "Extended functionality for fs",

@@ -13,3 +13,4 @@ "author": "David De Anda <david@universal-packages.com> (https://github.com/universal-packages)",

"test": "jest --watch",
"test:full": "jest --coverage --verbose"
"test:full": "jest --coverage --verbose",
"test:clear": "jest --clearCache"
},

@@ -16,0 +17,0 @@ "dependencies": {},

16

README.md

@@ -15,4 +15,6 @@ # fs Utils

## checkDirectory()
## Global methods
#### **`checkDirectory(location: String)`**
Checks if a string is a valid path to a directory and expands it.

@@ -45,3 +47,3 @@

## checkFile()
#### **`checkFile(location: String)`**

@@ -75,3 +77,3 @@ Checks if a string is a valid path to a file and expands it.

## ensureDirectory()
#### **`ensureDirectory(location: String)`**

@@ -104,5 +106,5 @@ Checks and expand a path and tries to create the directory if the check fails.

## ensureFile()
#### **`ensureFile(location: String)`**
Checks and expand a path and tries to create an empty file if the check fails
Checks and expand a path and tries to create an empty file if the check fails

@@ -133,3 +135,3 @@ ```js

## expandPath()
#### **`expandPath(location: String)`**

@@ -153,3 +155,3 @@ Tries to expand a path by resolving the tilde and resolving to an absolute path.

The development of this library in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.
The development of this library happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving this library.

@@ -156,0 +158,0 @@ - [Code of Conduct](./CODE_OF_CONDUCT.md)

@@ -44,3 +44,3 @@ "use strict";

catch {
throw new Error(`Directory "${finalLocation}" is an invalid path or greater permisons are reaquired`);
throw new Error(`Directory "${finalLocation}" is an invalid path or greater permissions are reacquired`);
}

@@ -58,3 +58,3 @@ }

catch {
throw new Error(`File location "${finalLocation}" is an invalid path or greater permisons are reaquired`);
throw new Error(`File location "${finalLocation}" is an invalid path or greater permissions are reacquired`);
}

@@ -66,6 +66,6 @@ return finalLocation;

function expandPath(location) {
const expanded = !exports.IS_WINDOWS && exports.HOME_DIR ? location.replace(/^~(?=$|\/|\\)/, exports.HOME_DIR) : location;
return path_1.default.resolve(expanded);
const expanded = location && !exports.IS_WINDOWS && exports.HOME_DIR ? location.replace(/^~(?=$|\/|\\)/, exports.HOME_DIR) : location;
return expanded ? path_1.default.resolve(expanded) : expanded;
}
exports.expandPath = expandPath;
//# sourceMappingURL=utils.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc