Socket
Socket
Sign inDemoInstall

os-fonts

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

os-fonts - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

20

index.js

@@ -1,4 +0,5 @@

const recursive = require('recursive-readdir');
const path = require('path');
const os = require('os');
const recursive = require('recursive-readdir');
const recursiveSync = require('recursive-readdir-sync');

@@ -50,2 +51,16 @@ if (process.platform !== 'win32') {

/**
* Retrieve all font files in the given directory (synchronous).
*
* @param {String} dir - The directory to read
* @return {Promise} - Array of fonts
*/
exports.getFontsInDirectorySync = dir => {
try {
return recursiveSync(dir);
} catch (err) {
return [];
}
};
/**
* Get all fonts.

@@ -58,1 +73,4 @@ *

exports.getFontsInDirectory(FONT_DIRS[process.platform][useType]);
exports.getAllSync = (useType = 'system') =>
exports.getFontsInDirectorySync(FONT_DIRS[process.platform][useType]);

5

package.json
{
"name": "os-fonts",
"description": "Retrieve fonts available on your OS.",
"version": "0.4.0",
"version": "0.4.1",
"author": "Vu Tran <vu@vu-tran.com>",
"dependencies": {
"recursive-readdir": "github:niftylettuce/recursive-readdir"
"recursive-readdir": "^2.2.1",
"recursive-readdir-sync": "^1.0.6"
},

@@ -9,0 +10,0 @@ "devDependencies": {

@@ -42,2 +42,6 @@ # os-fonts

### getAllSync([useType])
Returns paths to all fonts (synchronous version of `getAll`).
### getFontsInDirectory(dir)

@@ -53,4 +57,8 @@

### getFontsInDirectory(dir)
Returns paths to all fonts in the given directory (synchronous version of `getFontsInDirectory`).
## License
MIT © [Vu Tran](https://github.com/vutran/)

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