npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

daily-needs

v1.1.1

Published

Daily need is an npm package which comes with all daily needs functions which a software developer requires while developing app.

Downloads

2

Readme

Daily Needs

Daily Needs is an npm package that provides a collection of functions catering to the daily needs of software developers during app development.

Installation

You can install daily-needs via npm:

npm install daily-needs


Usage

#### Import statement
import { returnCommonRecords, removeDuplicates, filterArrayByKeyValue } from 'daily-needs';



### returnCommonRecords()
returnCommonRecords(array1, array2, key)
This function takes two identical arrays and a key value, and returns the common records between them.


### Parameters
Parameters:
array1: Array - The first array.
array2: Array - The second array.
key: String - The key to compare the records


## Returns
Returns:
Array - An array containing the common records.


## Example
Example:
const result = returnCommonRecords(array1, array2, key);






## removeDuplicates()
removeDuplicates(array, key)
This function removes duplicates from the provided array based on the specified key.


### Parameters
Parameters:
array: Array - The input array.
key: String - The key to identify duplicates.


### Returns
Returns:
Array - An array with duplicates removed.


## Example
Example:
const result = removeDuplicates(array1, key);






#### filterArrayByKeyValue()
filterArrayByKeyValue(array, key, value)
This function filters an array based on the provided key and value.


### Parameters
Parameters:
array: Array - The input array.
key: String - The key to filter by.
value: Any - The value to filter for.


## Returns
Returns:
Array - An array containing the filtered records.


## Example
Example:
const result = filterArrayByKeyValue(array1, key, value);


### Manipulate Date
This function manipulates date and time 

Parameters:
Date: This should be Date string    eg: const d = new Date(); d.toString();
dateOnly: This is boolean parameter, formats only date
timeOnly: This is boolean parameter, formats only time
dateTime: This is boolean parameter, formats both date and time


Note: First parameter is Date string which is mandatory, and rest parameter pass only true to what you wabnt to format, others must be passed as false

dateManipulate(dateString:string, dateOnly:boolean, timeOnly:boolean, dateTime:boolean);

eg: First Get Date or Create Date

const date = '2024-02-27T16:35:13.088Z'

OR

const d = new date()
const date = d.toString()


OR

const d = new date(YOUR_OWN_DATE_STRING);
const date = d.toString()



const formatDate = dateManipulate(date , true, false, false);
const formatTime = dateManipulate(date , false, true, false);
const formatDateTime = dateManipulate(date , false, false, true);





License
This project is licensed under the MIT License
Feel free to adjust the content or formatting as needed!

Author: Pawan Darji
Email: [email protected]