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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aimu/date-manipulator

v1.2.0

Published

Built for solving date and time manipulation problems.

Downloads

18

Readme

Date-manipulator

npm npm bundle size PRs Welcome Node.js CI

This is a simple date and time manipulator. Using this package you can get some helpful features like finding difference between dates, and getting current date and time by passing a string. More features are being developed by our team.

Installation

Install this package via npm:

npm install @aimu/date-manipulator

This package is also available on unpkg, so you can load it via script tag:

<script src="https://unpkg.com/@aimu/date-manipulator"></script>
<script>
  // You can use library features here.
</script>

Usage

Input

You can pass any valid arguments of Date() built-in javascript object.

You can also pass options as object, right now, there's only one option available: hFormat: 12 or 24 as string value (It's 24 by default).

Example:

var d = new dateM({
  hFormat: '12',
});
console.log(d.current('dd-mm-yyyy hh:mm')); // Prints current date and time format in 12 hours.

Methods

dateM().current()

This method returns a string replaced by a requested values.

var d = new dateM();

// dd - date, mm - month, yyyy - year.
// You can also get month and day as string value by passing day or month.
// Note: time representing characters must be separated by colon(:).
// hh:mm:ss - OK
// hh mm ss - Warning: You may don't get what you expect.

// Example:
d.current('dd-mm-yyyy hh:mm:ss'); // Prints current date and time.
d.current('day, month yyyy'); // Prints day & month strings, and year.

dateM().unixTime()

This method returns unix time in miliseconds.

dateM.timePassed()

Using this method you can get difference between two dates in days.

Note: Arguments should be dateM objects.

Example:

var b = new dateM(2020, 0, 1);
var e = new dateM(2021, 0, 1);

console.log(dateM.timePassed(b, e)); // Prints 366

To-do list

  • [ ] Adding timezone option.
  • [ ] Validation of arguments.
  • [ ] Error handling.
  • [x] String values for day and month.
  • [ ] Creating a meaningful and helpful documentation.
  • [ ] Adding some options for timePassed method.
  • [ ] Adding some more features.

Ofcourse, there's a lot to-do.

Contributing

Thank you for considering contributing to our project.

Here are instructions for contributing.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

Working on your first Pull Request?

You can learn how from this free series How to Contribute to an Open Source Project on GitHub

License

MIT