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

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.3.1 to 0.3.2

__mocks__/recursive-readdir.js

14

__tests__/index.js
import m from '../';
jest.mock('fs');
jest.mock('recursive-readdir');
describe('os-fonts', () => {
const fs = require('fs');
const recursive = require('recursive-readdir');
it('should retrieve some fonts', async () => {
// set up mock data
fs.__setFiles([
recursive.__setFiles([
'foo.ttf',

@@ -19,3 +19,3 @@ 'bar.ttf',

it('should retrieve no fonts', async () => {
fs.__setFiles([]);
recursive.__setFiles([]);
const fonts = await m.getAll();

@@ -27,3 +27,3 @@ expect(fonts.length).toBe(0);

// set up mock data
fs.__setFiles([]);
recursive.__setFiles([]);
const fonts = await m.getAll('user');

@@ -35,3 +35,3 @@ expect(fonts.length).toBe(0);

// set up mock data
fs.__setFiles([
recursive.__setFiles([
'foo.ttf',

@@ -47,3 +47,3 @@ 'bar.ttf',

it('should return nothing for readdir errors', async () => {
fs.__setReturnError(true);
recursive.__setReturnError(true);
const fonts = await m.getAll('network');

@@ -50,0 +50,0 @@ expect(fonts.length).toBe(0);

@@ -0,3 +1,3 @@

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

@@ -39,3 +39,3 @@

exports.getFontsInDirectory = dir => new Promise((resolve) => {
fs.readdir(dir, (err, files) => {
recursive(dir, (err, files) => {
if (err) {

@@ -45,3 +45,3 @@ resolve([]);

}
resolve(files.map(f => path.join(dir, f)));
resolve(files);
});

@@ -48,0 +48,0 @@ });

{
"name": "os-fonts",
"version": "0.3.1",
"description": "Retrieve fonts available on your OS.",
"keywords": [
"fonts",
"font",
"os",
"system"
],
"main": "index.js",
"scripts": {
"lint": "eslint index.js __tests",
"test": "npm run lint && jest --coverage"
},
"version": "0.3.2",
"author": "Vu Tran <vu@vu-tran.com>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/vutran/os-fonts.git"
"dependencies": {
"recursive-readdir": "github:niftylettuce/recursive-readdir"
},
"dependencies": {},
"devDependencies": {

@@ -28,2 +14,3 @@ "babel-jest": "^16.0.0",

"babel-preset-es2015": "^6.18.0",
"coveralls": "^2.11.14",
"eslint": "^3.9.0",

@@ -34,3 +21,19 @@ "eslint-config-airbnb-base": "^9.0.0",

"jest": "^16.0.2"
},
"keywords": [
"font",
"fonts",
"os",
"system"
],
"license": "MIT",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/vutran/os-fonts.git"
},
"scripts": {
"lint": "eslint index.js __tests",
"test": "jest --coverage"
}
}
# os-fonts
[![Travis](https://img.shields.io/travis/vutran/os-fonts/develop.svg?maxAge=2592000&style=flat-square)](https://travis-ci.org/vutran/os-fonts) [![Coveralls branch](https://img.shields.io/coveralls/vutran/os-fonts/develop.svg?maxAge=2592000&style=flat-square)](https://coveralls.io/github/vutran/os-fonts) [![license](https://img.shields.io/github/license/vutran/os-fonts.svg?maxAge=2592000&style=flat-square)](LICENSE)
> Retrieve fonts available on your OS.

@@ -4,0 +6,0 @@

Sorry, the diff of this file is not supported yet

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