Skip to content

Newnich/my-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-app

CI Coverage

Small Node.js utility library with Jest tests, coverage reporting, and GitHub Actions CI.

Install

npm install

Scripts

  • npm start runs the app entrypoint.
  • npm run dev runs the app in watch mode.
  • npm test runs the Jest suite.
  • npm run coverage runs Jest with coverage output.

Usage

const { sum, isPalindrome } = require("./src/utils");
const { multiply, divide } = require("./src/math");
const { unique, flatten } = require("./src/array");
const { getEnv } = require("./src/config");

console.log(sum([1, 2, 3]));
console.log(isPalindrome("Racecar"));
console.log(multiply(4, 5));
console.log(divide(12, 3));
console.log(unique([1, 1, 2, 3]));
console.log(flatten([[1, 2], [3, 4]]));
console.log(getEnv("PORT", 3000));

Subpath Imports

The package supports subpath imports, so consumers can import only the module they need:

const { sum } = require("newnich-my-app/utils");
const { multiply } = require("newnich-my-app/math");
const { unique } = require("newnich-my-app/array");
const { fetchJson } = require("newnich-my-app/api");

This avoids importing internal file paths directly.

Modules

  • src/utils.js: date formatting, summation, palindrome checks
  • src/math.js: multiply and divide helpers
  • src/string.js: string capitalization and reversal
  • src/array.js: unique values and one-level flattening
  • src/date.js: day-distance calculation
  • src/config.js: environment lookup helper
  • src/api.js: JSON and text fetch helpers
  • src/errors.js: safe JSON parsing and retry logic
  • src/logger.js: formatted console logging helpers
  • src/fs.js: JSON file read and write helpers
  • src/async.js: delay and timeout helpers

CI

GitHub Actions runs the test and coverage workflow on every push and pull request through .github/workflows/test.yml.

Notes

  • Replace placeholder GitHub URLs in package.json with the live repository path.
  • The coverage badge is currently a static placeholder based on the latest local run.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors