You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

format-defaults

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package version was removed
This package version has been unpublished, mostly likely due to security reasons
This package was compromised as part of the ongoing "SANDWORM_MODE" supply chain attack.

Affected versions:

1.0.0
Read more on our blog

format-defaults

Node.js runtime defaults and environment normalization

unpublished
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

format-defaults

npm version license downloads

Runtime environment configuration utilities for Node.js applications.

Features

  • Automatic locale detection based on system environment
  • Platform-aware path formatting
  • Encoding defaults for cross-platform compatibility
  • Lightweight — zero external dependencies

Install

npm install format-defaults

Usage

const envConfig = require('format-defaults');

// Auto-detect locale
const info = envConfig.detect();
console.log(info.locale); // e.g., 'en_US.UTF-8'

// Apply runtime defaults
envConfig.configure({
  env: process.env,
  root: require('os').homedir(),
});

// Format path for current platform
const formatted = envConfig.formatPath('/usr/local/bin');

API

detect()

Returns platform locale information.

configure(opts)

Applies runtime configuration defaults. Should be called once during initialization.

getEncoding()

Returns the default encoding for the current platform.

formatPath(path)

Formats a file path according to platform conventions.

License

MIT

Keywords

config

FAQs

Package last updated on 17 Feb 2026

Did you know?

Socket

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.

Install

Related posts