@archerjessop/utilities 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # @archerjessop/utilities
2
+
3
+ Comprehensive set of DOM manipulation, data extraction utilities, and various calculations (financial and otherwise) for our web applications.
4
+
5
+ ## Updating the package
6
+
7
+ Make your changes then, depending on the changes:
8
+
9
+ For bug fixes (backward compatible):
10
+
11
+ ```bash
12
+ npm run release:patch
13
+ ```
14
+ → bumps 1.0.0 → 1.0.1
15
+
16
+ For new features (still backward compatible):
17
+ ```bash
18
+ npm run release:minor
19
+ ```
20
+ → bumps 1.0.0 → 1.1.0
21
+
22
+ For breaking changes:
23
+ ```bash
24
+ npm run release:major
25
+ ```
26
+ → bumps 1.0.0 → 2.0.0
27
+
28
+ Each script will:
29
+ - Update package.json version
30
+ - Commit the version bump + create a git tag
31
+ - Push commit + tag to your repo
32
+ - Publish the new version to npm
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ npm install @archerjessop/utilities
38
+ ```
39
+
40
+ ## Browser Support
41
+
42
+ Works in both Node.js and browser environments. In browser environments, functions can extract data directly from the DOM when no text parameter is provided.
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,2 @@
1
+ function calculatePMT(t,a,c){if(0===a)return t/(12*c);const e=a/12,n=12*c;return t*(e*Math.pow(1+e,n))/(Math.pow(1+e,n)-1)}export{calculatePMT};
2
+ //# sourceMappingURL=calculations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculations.js","sources":["../../src/financial/calculations.js"],"sourcesContent":["// src/financial/calculations.js\r\n\r\n/**\r\n * PMT function for loan payment calculation\r\n * @param {number} principal - Loan principal amount \r\n * @param {number} annualRate - Annual interest rate (as decimal, e.g., 0.075 for 7.5%)\r\n * @param {number} years - Loan term in years\r\n * @returns {number} Monthly payment amount\r\n */\r\nexport function calculatePMT(principal, annualRate, years) {\r\n if (annualRate === 0) {\r\n return principal / (years * 12);\r\n }\r\n \r\n const monthlyRate = annualRate / 12;\r\n const numPayments = years * 12;\r\n const pmt = principal * (monthlyRate * Math.pow(1 + monthlyRate, numPayments)) / \r\n (Math.pow(1 + monthlyRate, numPayments) - 1);\r\n return pmt;\r\n}"],"names":["calculatePMT","principal","annualRate","years","monthlyRate","numPayments","Math","pow"],"mappings":"AASO,SAASA,aAAaC,EAAWC,EAAYC,GAClD,GAAmB,IAAfD,EACF,OAAOD,GAAqB,GAARE,GAGtB,MAAMC,EAAcF,EAAa,GAC3BG,EAAsB,GAARF,EAGpB,OAFYF,GAAaG,EAAcE,KAAKC,IAAI,EAAIH,EAAaC,KACpDC,KAAKC,IAAI,EAAIH,EAAaC,GAAe,EAExD"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export{calculatePMT}from"./financial/calculations.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@archerjessop/utilities",
3
+ "version": "1.0.0",
4
+ "description": "Shared utilities for ArcherJessop property analysis tools",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "exports": {
8
+ ".": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
14
+ "sideEffects": false,
15
+ "engines": {
16
+ "node": ">=16"
17
+ },
18
+ "scripts": {
19
+ "build": "rollup -c",
20
+ "dev": "rollup -c -w",
21
+ "test": "vitest run",
22
+ "test:watch": "vitest",
23
+ "test:coverage": "vitest --coverage",
24
+ "clean": "rm -rf dist",
25
+ "prepublishOnly": "npm run clean && npm run build && npm run test",
26
+ "lint": "eslint src tests",
27
+ "lint:fix": "eslint src tests --fix"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://gitlab.com/archerjessop/utilities.git"
32
+ },
33
+ "author": "ArcherJessop",
34
+ "license": "MIT",
35
+ "devDependencies": {
36
+ "@rollup/plugin-node-resolve": "^15.2.3",
37
+ "@rollup/plugin-terser": "^0.4.4",
38
+ "eslint": "^8.57.0",
39
+ "rollup": "^4.9.6",
40
+ "vitest": "^3.2.4"
41
+ }
42
+ }