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

fh-db

v3.3.2

Published

FeedHenry Database Library

Downloads

334

Readme

fh-db(1) -- The FeedHenry Database access library

npm package

Dependency Status Known Vulnerabilities

| | Project Info | | --------------- | ------------- | | License: | Apache License, Version 2.0 | | Build: | npm | | Documentation: | http://docs.feedhenry.com/v3/api/cloud_api.html | | Issue tracker: | https://issues.jboss.org/projects/FH/summary | | Mailing list: | feedhenry-dev (subscribe) | | IRC: | #feedhenry channel in the freenode network. |

DESCRIPTION

This contains the fh.db() layer the works above the mongodb library. It has a Ditch-like interface, with the same actions and parameters

Installation

Add fh-db as a dependency to your module and require it where required, like any other npm module

Testing

N.B. This guide assumes you have a functional docker-machine.

Start Mongo Server

Start the docker machine for the version of mongo you wish to test:

docker run -d -p 27017:27017 mongo:2.6

Note for docker-machine users

You will need to connect your localhost:27017 to the docker-machine:27017, do this with the following command:

VBoxManage controlvm `docker-machine active` natpf1 "docker-mongo,tcp,127.0.0.1,27017,,27017"

In the above docker-mongo is the name of the rule, this is important to remember, in order to remove it when not required.

Remove the above rule as follows:

VBoxManage controlvm `docker-machine active` natpf1 delete docker-mongo

Setup Mongo Database

connect to Mongo:

mongo

For MongoDB versions > 3.x

Well, instead of MongoDB 2.6 stated above if you used MongoDB 3.x, you will need to update the authentication to work with fh-db, which is done as follows:

use admin
db.system.users.remove({})
db.system.version.remove({})
db.system.version.insert({ "_id" : "authSchema", "currentVersion" : 3 })

Then exit mongo and restart the docker container:

docker stop <container-name>
docker start <container-name>

And reconnect to mongo:

mongo

Add the admin user:

use admin
db.createUser({user: 'admin', pwd: 'admin', roles: ['root']})
Test the login:

exit mongo and run:

mongo admin -u admin -p admin

Add the ditchuser

Log in as the admin user, if you are not yet, then run:

use fh-ditch
db.createUser({user: 'ditchuser', pwd: 'ditchpassword', roles: ['dbAdmin']})
Test the login:

Exit Mongo and run:

mongo fh-ditch -u ditchuser -p ditchpassword

Execute the test

grunt fh:unit