{"id":17771425,"url":"https://github.com/rootslab/nprime","last_synced_at":"2025-03-15T16:31:02.823Z","repository":{"id":26752911,"uuid":"30210740","full_name":"rootslab/nprime","owner":"rootslab","description":"Nprime, a simple and fast naive module for testing/calculating primes on the fly.","archived":false,"fork":false,"pushed_at":"2018-02-10T14:41:06.000Z","size":247,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T03:25:52.094Z","etag":null,"topics":["calculating-primes","naive","nodejs","prime-numbers"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rootslab.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-02T21:54:29.000Z","updated_at":"2018-02-22T15:27:37.000Z","dependencies_parsed_at":"2022-09-01T21:11:07.701Z","dependency_job_id":null,"html_url":"https://github.com/rootslab/nprime","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fnprime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fnprime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fnprime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rootslab%2Fnprime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rootslab","download_url":"https://codeload.github.com/rootslab/nprime/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243759719,"owners_count":20343611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculating-primes","naive","nodejs","prime-numbers"],"created_at":"2024-10-26T21:32:50.384Z","updated_at":"2025-03-15T16:31:02.818Z","avatar_url":"https://github.com/rootslab.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Nprime\n\n[![NPM VERSION](http://img.shields.io/npm/v/nprime.svg?style=flat)](https://www.npmjs.org/package/nprime)\n[![CODACY BADGE](https://img.shields.io/codacy/b18ed7d95b0a4707a0ff7b88b30d3def.svg?style=flat)](https://www.codacy.com/public/44gatti/nprime)\n[![CODECLIMATE-TEST-COVERAGE](https://img.shields.io/codeclimate/c/rootslab/nprime.svg?style=flat)](https://codeclimate.com/github/rootslab/nprime)\n[![LICENSE](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/rootslab/nprime#mit-license)\n\n![NODE VERSION](https://img.shields.io/node/v/nprime.svg)\n[![TRAVIS CI BUILD](http://img.shields.io/travis/rootslab/nprime.svg?style=flat)](http://travis-ci.org/rootslab/nprime)\n[![BUILD STATUS](http://img.shields.io/david/rootslab/nprime.svg?style=flat)](https://david-dm.org/rootslab/nprime)\n[![DEVDEPENDENCY STATUS](http://img.shields.io/david/dev/rootslab/nprime.svg?style=flat)](https://david-dm.org/rootslab/nprime#info=devDependencies)\n\n[![NPM MONTHLY](http://img.shields.io/npm/dm/nprime.svg?style=flat)](http://npm-stat.com/charts.html?package=nprime)\n![NPM YEARLY](https://img.shields.io/npm/dy/nprime.svg)\n\n[![NPM GRAPH](https://nodei.co/npm/nprime.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/nprime/)\n\n\u003e __Nprime__, a simple and fast __naive__ module for testing/calculating primes on the fly.\n\n### Install\n\n```bash\n$ npm install nprime [-g]\n```\n\n\u003e __require__:\n\n```javascript\nvar Nprime  = require( 'nprime' );\n```\n### Run Tests\n\n\u003e __to run all test files, install devDependecies:__\n\n```bash\n $ cd nprime/\n # install or update devDependecies\n $ npm install --dev\n # run tests\n $ npm test\n```\n\u003e __to execute a single test file simply do__:\n\n```bash\n $ node test/file-name.js\n```\n### Run Benchmarks\n\n\u003e run benchmark (find the first million of primes):\n\n```bash\n $ cd nprime/\n $ npm run bench\n # or to run a single file\n $ node bench/file-name-bench.js\n```\n----------------------------------------------------------------------------------------------\n\n### Methods\n\n\u003e Arguments within [ ] are optional.\n\n```javascript\n/*\n * Check if the number is composite.\n * It returns the value of first divisor,\n * or -1 if number is a prime.\n */\nNprime#test : function () : Number\n\n/*\n * Get the next prime p \u003e= n, use strict for \u003e.\n */\nNprime#next : function ( Number n [, Boolean strict ] ) : Number\n\n/*\n * Get the previous prime p \u003c= n, use strict for \u003c.\n */\nNprime#prev : function ( Number n [, Boolean strict ] ) : Number\n```\n\n### MIT License\n\n\u003e Copyright (c) 2014-present \u0026lt; Guglielmo Ferri : 44gatti@gmail.com \u0026gt;\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining\n\u003e a copy of this software and associated documentation files (the\n\u003e 'Software'), to deal in the Software without restriction, including\n\u003e without limitation the rights to use, copy, modify, merge, publish,\n\u003e distribute, sublicense, and/or sell copies of the Software, and to\n\u003e permit persons to whom the Software is furnished to do so, subject to\n\u003e the following conditions:\n\n\u003e __The above copyright notice and this permission notice shall be\n\u003e included in all copies or substantial portions of the Software.__\n\n\u003e THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n\u003e EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\u003e MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n\u003e IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n\u003e CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n\u003e TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n\u003e SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fnprime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frootslab%2Fnprime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frootslab%2Fnprime/lists"}