Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Abstraction Layer for File Management.
$ npm install --save smart-fs
Extends and returns filepath with the file extension as appropriate. Returns null
if no good match was found.
A few notes:
null
when multiple possible extensions are foundIteratively walk dirpath and return relative paths of all files contained.
Will only return entries where fs.lstatSync(...).isFile()
evaluates to true (this excludes symlinks).
Delete file and all empty parent directories.
Read and parse file based on file extension.
The following extensions are handled in order:
.json
: Loads file using JSON.parse..xml
: Loads file using xml-js..yml
and .yaml
: Loads file using yaml-boost..js
: Loads file using require..*
: Treats file as text file and loads as array of lines.Note that the required cache is not automatically invalidated when loading cached .js
files.
To ignore file extension and force treat the file as a certain type, you can pass the option treatAs
as e.g. json
.
Serialize and write content to file based on file extension.
The file and all necessary folders are created if not present.
The file is only actually written if the content has changed. Returns true if the file was written, false otherwise.
The following extension are handled in order:
.json
: Serialize uses JSON.stringify..xml
: Serialize using xml-js..yml
and .yaml
: Serialize uses yaml-boost..*
: Expects content as array and serializes by joining array using new line character.To ignore file extension and force treat the file as a certain type, you can pass the option treatAs
as e.g. json
.
The mergeStrategy
option can be used to customize how the new content is merged if the target file already exists.
By default the file is simply overwritten.
Do not use this library for loading if you don't trust the source of the files you are loading!
FAQs
Abstraction Layer for File Management.
The npm package smart-fs receives a total of 624 weekly downloads. As such, smart-fs popularity was classified as not popular.
We found that smart-fs 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.