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

fm-primes

v1.0.2

Published

Prime Numbers

Downloads

6

Readme

Prime Numbers

Run npm run fm-primes and by requiring it, you can work with it. The main file is primeTextWay.js, but you can require other js files. For python one, you can check inside node_modules and copy all the files inside prime-py into your root file and then you can use them. You can create prime files by using this way, but you do not have access to the existing prime-output or prime-output-big folders. But you can use allPrimesSecondWay ,primeInRangeObjTextWay, or primeInRangeObj methods to create prime-output folder.

Or you can run mv ./node_modules/fm-primes/prime-output . and mv ./node_modules/fm-primes/prime-output-big .. Even if you want, you can run mv ./node_modules/fm-primes . and it will give you all the files. and you can use them.

The point is: by just requiring it, you do not have access to prime-output or prime-output-big folder. You can create files by your own using allPrimesSecondWay ,primeInRangeObjTextWay, or primeInRangeObj methods.

prime-js

  • On this folder, there is another Readme

  • Different ways for dealing with prime numbers.

  • The output of each js file can be executed using node. The prime files output can be saved on prime-output folder. (if you run it from root, otherwise it will be saved on the path that you run it. Then better to for example run node ./prime-js/primeTextWay.js)

  • Javascript can not deal with big number. By big numbers I mean any numbers bigger than 9007199254740991. Always need to check the number and if it works on that number. ( how? easy: run num + 1 == num and if it is true, it means js can not deal with it). One example is primeSixthWay.js. There are some lines that need to square a number, and that will make some issues.

  • To deal with JS limitation on big numbers, you can use prime-js-big-numbers which will work with mathOperation.js which can deal with big numbers. Or you can work with python on prime-py folder.

prime-js-big-numbers

  • On this folder, there is another Readme

  • Different ways for dealing with prime numbers.

  • The output of primeString.js file can be executed using node. The prime files output can be saved on prime-output-big folder. (if you run it from root, otherwise it will be saved on the path that you run it. Then better to for example run node ./prime-js-big-numbers/primeString.js)

  • Javascript can not deal with big number. By big numbers I mean any numbers bigger than 9007199254740991. Always need to check the number and if it works on that number. ( how? easy: run num + 1 == num and if it is true, it means js can not deal with it). This folder is to deal and work with big numbers on js. (Better to work with prime-py)

prime-py

  • On this folder, there is another Readme

  • Different ways for dealing with prime numbers.

  • The output of primeString.js file can be executed using python3. The prime files output can be saved on prime-output folder. (if you run it from root, otherwise it will be saved on the path that you run it. Then better to for example run python3 prime-py/primeTextWay.py)