diff --git a/.husky/pre-commit b/.husky/pre-commit
index 98475b5..009b3f8 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-pnpm test
+pnpm lint
diff --git a/.husky/pre-push b/.husky/pre-push
new file mode 100644
index 0000000..98475b5
--- /dev/null
+++ b/.husky/pre-push
@@ -0,0 +1 @@
+pnpm test
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..b7425b9
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1 @@
+enable-pre-post-scripts=true
\ No newline at end of file
diff --git a/.xo-config.json b/.xo-config.json
index 9e3acef..1a87094 100644
--- a/.xo-config.json
+++ b/.xo-config.json
@@ -1,6 +1,11 @@
{
+ "env": ["jest", "node"],
"rules": {
"import/extensions": "off",
- "unicorn/prefer-module": "off"
+ "unicorn/prefer-module": "off",
+ "unicorn/no-array-for-each": "off",
+ "unicorn/prefer-top-level-await": "off",
+ "@typescript-eslint/no-unsafe-call": "off",
+ "@typescript-eslint/no-unsafe-assignment": "off"
}
}
\ No newline at end of file
diff --git a/README.md b/README.md
index 253e921..f0dcb33 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,82 @@
# n-tuple-array
-Get a configurable amount of items from a JS array, instead of only one item
+
+Get a specified amount of items when iterating over a JavaScript array, instead of the single item that arrays provide per iteration, by default.
+
+
+## Motivation
+
+Imagine that you received a collection of coordinates (latitude and longitude), but they were sent
+as a flat array of values to speed up the data transfers.
+
+`n-tuple-array` can help you get out the coordinates in pairs (their logical representation), such that you'd go **from**
+```json
+// flatCoords
+["5.7225", "-9.6273", "2.68452", "-30.9501", ...]
+```
+
+**to**
+```javascript
+// generate pairs by default
+const coordIterable = tuplesFromArray({ list: flatCoords });
+
+// using for..of, get pairs as ["5.7225", "-9.6273"] ...
+for (const pair of coordIterable) {
+ console.log(pair);
+}
+
+// OR manipulate pairs with regular array functions
+const coordPairs = Array.from(coordIterable);
+console.log(Array.isArray(coordPairs)); // true
+// prints ["5.7225", "-9.6273"] ...
+coordPairs
+ .map(pair => myTransform(pair))
+ .forEach((pair) => placeOnMap(pair));
+```
+
+### Some Real World Examples
+> I first had this idea and tried my hands on it when [building wole-joko](https://github.com/chalu/wole-joko/blob/dev/src/js/utils.js#L57-L92), a live coding task I was asked to do in an engineering manager interview. It was a simulation of people entering an event hall to get seated, but only two could get it/be attended to at a time. I later took some time to [bring the project to live](https://wole-joko.netlify.app/)
+
+> The below example was adapted for more concise terminal output
+
+
+
+JS challenge by @thdxr on X.com
+
+