18.1.1 • Published 5 months ago

@wixc3/fs-utils v18.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

npm version @wixc3/fs-utils on Github

Home > @wixc3/fs-utils

fs-utils package

Functions

FunctionDescription
addRelativePrefix(path)
backSlash(str, type)Ensure a single heading/trailing backslash (/) of a single line string
createImportPath({ importedFilePath, targetFilePath, targetPackageJsonPath, fs, })Returns relative import path if imported and target files are in the same package, otherwise returns a bare import specifier.
formatToOSpaths(str)
getBareImportSpecifier(absoluteImportPath, packageJsonPath, packageJsonName)Creates bare import specifier for an absolute import path, stripping extension from JS/TS files.
getDTSPath(filePath)
getFullExtname(filePath)Returns file extension from the first occurrence of the ".", unlike path.extname() which returns from the last occurrence.
getImportPath(filePath)
getPackageJsonPath(filePath, fs)Gets path to package.json file closest to the given file path.
getPackageName(dirPath, fs)Gets package name.
getPackagePath(filePath, fs)Gets path to package directory, closest to the given file path.
getRelativeImportPath(sourceFilePath, filePathToImport)Creates relative import path for a file, stripping extension from JS/TS files.
getRelativeModulePath(sourceAbsFilePath, targetAbsFilePath)
isDirPath(filePath)
isJavaScriptFile(filePath)
isJsonFile(filePath)
isPathIncludesDir(filePath, directoryName)Safely checks if a path contains a directory name.
isRelativeModulePath(path)
isRelativeModuleRequest(request)
isSubPath(path, basePath, fs)Checks if a path is equal to or subpath of a given base path.
isTsOrJS(filePath)
isTypeAffectingFileOrDir(filePath)
isTypeScriptFile(filePath)
isWindowsStyleAbsolutePath(fsPath)
pathChainToRoot(currentPath)
pathToTrueCase(fs, path)Returns case-exact absolute form of the path, similar to fs.realpathSync.native() Trailing segments of the path that don't exist are left unchanged.
readPackageJson(dirPath, fs)Read and parse a directory's package.json
rebaseRelativeModulePath(filePath, modulePath)
replaceWinSlashes(str)

Interfaces

InterfaceDescription
AdjustRelativeImportPathArgs
CreateImportPathArgs

Variables

VariableDescription
fileRequestPrefixprefix for file requests in Language server protocol
18.1.1

5 months ago

18.1.0

5 months ago

18.0.0

6 months ago

17.1.1

1 year ago

17.0.0

1 year ago

16.3.0

1 year ago

16.2.1

1 year ago

16.2.0

1 year ago

16.1.3

1 year ago

16.1.0

1 year ago

16.0.0

1 year ago

15.1.1

1 year ago

15.1.0

1 year ago

15.0.0

1 year ago

14.0.0

2 years ago

14.1.0

2 years ago

13.4.0

2 years ago

13.3.2

2 years ago

13.2.0

2 years ago

13.3.0

2 years ago

13.0.0

2 years ago

13.1.0

2 years ago

13.0.1

2 years ago

12.0.3

2 years ago

12.0.4

2 years ago

12.1.0

2 years ago

12.0.1

2 years ago

11.1.1

2 years ago

11.1.0

2 years ago

11.0.0

2 years ago

10.0.0

2 years ago

8.2.1

2 years ago

9.0.0

2 years ago

7.2.0

2 years ago

8.1.0

2 years ago

8.0.0

2 years ago

8.2.0

2 years ago

7.0.3

2 years ago

7.0.0

2 years ago

6.0.0

2 years ago

5.3.0

3 years ago

5.2.4

3 years ago

5.2.3

3 years ago

5.1.0

3 years ago

5.0.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.7

3 years ago

3.0.5

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.0

3 years ago

2.2.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago