From ff949155d0c673866c811f283ee09e2c08d02536 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Fri, 6 Mar 2020 08:35:03 +0100 Subject: [PATCH] add readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..baf784b --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Utilities + +General helper functions + +``` +const util = require('@scode/utilities'); + +// cut off decimal places to a specified point +util.truncate_decimal(12.345678, 2); +// returns 12.34 + +// will return null instead of throwing on invalid json +util.try_parse_json('{{foo'); +```