npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

shoe-size-converter

v1.0.1

Published

Convert your shoe size

Downloads

2,639

Readme

shoe-size-converter

Convert your shoe size 👟

Build Status

Usage

npm install shoe-size-converter --save

import {convert, iso} from 'shoe-size-converter';

convert({size: 36.5, system: 'eu'}, iso);
// =>
[{
	size: 4,
	prettySize: '4',
	system: 'au',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'au',
	women: true
}, {
	size: 5,
	prettySize: '5',
	system: 'brannock',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'brannock',
	women: true
}, {
	size: 23,
	system: 'cm',
	unisex: true
}, {
	size: 36.5,
	system: 'eu',
	unisex: true
}, {
	size: 230,
	system: 'mondopoint',
	unisex: true
}, {
	size: 3.5,
	prettySize: '3 1/2',
	system: 'mx',
	men: true,
	women: true
}, {
	size: 4,
	prettySize: '4',
	system: 'uk',
	men: true,
	women: true
}, {
	size: 5,
	prettySize: '5',
	system: 'us',
	men: true
}, {
	size: 6,
	prettySize: '6',
	system: 'us',
	women: true
}]

API

convert(parameters, systems, [options]);

parameters.size

Type: string|number

The shoe size you want to convert.

Can either be a size in number, or a string that can be transformed using each system's pretty transformers. For inch-based sizes, the iso system default to handling 'X Y/Z' formats (where Z is 2, 4 or 8).

[parameters.system]

Type: string

The system of the specified size

Default: As specified in systems. For iso: mondopoints

[parameters.women]

Type: boolean

Whether the passed in size should be treated as a women's size. Otherwise treated as a men's size (unless parameters.children has been specified).

Default: false

[parameters.children]

Type: boolean

Whether the passed in size should be treated as a children's size. Otherwise treated as a men's size (unless parameters.women has been specified).

Default: false

system

Type: A System

Usually iso is passed in, unless you want to use a custom system.

Check systems/iso/index.js for an example of the format.

options.footToLast

Type: Function

A function to convert between foot length and last length (both ways). See helpers.js for the existing/default one and use the same function signature if you want to provide a custom one.

The default implementation follows ISO, i.e. 2 size difference for adults, and 8% for children.

Default: See helpers.js -> footToLast

options.round

Type: Function

A function to round shoe sizes to reasonable sizes. See helpers.js for the existing/default one and use the same function signature if you want to provide a custom one.

Works in tandem with the round-property on each system.

Default: See helpers.js -> round

How it works

Converts footwear (shoe) sizes using a collection of sizing systems, provided along when converting. Each system support converting from the system to a unified format and from the unified format back to the system format. The default system follows the ISO standard (roughly - even the ISO standard say that footwear size conversion isn't a solved problem yet, unfortunately).

The default collection of systems included (iso) follows the ISO standardization (all systems convert to mondopoints and back for conversion) and implements the following systems ( either according to spec, or best match possible):

  • Mondopoint (mm, mondo, mondopoints)
  • EU
  • UK
  • US
  • Brannock (currently the same as US)
  • cm
  • AU
  • MX

See each system file for comments and details. They are quite short and easy to read.

Custom system collection

To implement your own systems, see the current implementation(s) at systems/iso/ (or systems/table/) for reference. As long as the same structure is followed, it should be fairly trivial.

Table-based system (and backwards compatibility)

There's a table-based systems collection which can be used instead of iso:

import {convert} from 'shoe-size-converter';
import {table} from 'shoe-size-converter/systems/table';

convert({size: 36.5, system: 'eu'}, table);
// => Same format as above - but with different conversion result

Currently, it's based on the old sizing table, which means it can be used to have the same conversion as version 0.0.5 and earlier, BUT with the new API.

The old conversion table can be found in the size-tables.js file, along with other conversion tables.