Format swedish phone numbers according to the specification at https://www.pts.se/sv/Bransch/Telefoni/Nummerfragor/Telefoninummerplanen/Telefoninummerplanens-disposition/ and http://www.sprakbruk.fi/media/sprakbruk_2009.2_artikel_14.pdf
$ npm install --save swedish-phone-number-formatter
const format = require("swedish-phone-number-formatter");
format("031123456"); // => '031-12 34 56'
MIT © Jonathan Svenheden