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

fdq

v0.0.4

Published

Finite Domain reduction system and solver by qFox

Downloads

21

Readme

FDQ - Finite Domain solver by qFox

This is a finite domain reduction system and solver combined. The fdq package combines fdo and fdq together.

Usage

After the customary npm install fdq, you can find the main entry point in FDQ.solve(problem, fdpOptions, fdoOptions).

For example:

import FDQ from 'fdq';
let solution = FDQ.solve(`
  : A, B, C [0 1]
  A != B
  A !& C
`);
log(solution); // -> {A: 0, B: 1, C: 1}

Examples

There is a REPL (online web-based playground) available: https://qfox.github.io/fdq/examples/playground.html

Some examples:

Development

To set up a development environment create a main project dir. Inside it clone the following repos:

  • fdh - all the generic e2e/integration tests for both fdo and fdq
  • fdlib - shared code for fdo and fdq
  • fdo - a constraint brute force solver
  • fdp - a constraint problem reduction system
  • fdq - this repo
  • fdv - an automated verifier for tests
  • fdz - (optional) these are performance tests (they might be merged into the fdq repo instead)

Run npm install and you should be able to use the CLI tools.

CLI

Grunt scripts:

  • grunt clean - remove build and dist
  • grunt build - concat all the source files from fdlib, fdo, and fdp together and babel them to es5
  • grunt dist - lint, test, build, and minify, this creates the final dist build
  • grunt distq - dist build only, also generates a more generic fdq.js
  • grunt distbug - like build but instead of minify keeps development mnemonics like logging and assertions
  • grunt distheat - like build instead of minify does a beautify
  • grunt test - lint and test, also copies to fdq.js
  • grunt testq - distq and run tests, collect all errors, also copies to fdq.js
  • grunt testb - distb and run tests, collect all errors, also copies to fdq.js
  • grunt testh - disth and run tests, collect all errors, also copies to fdq.js
  • grunt testtb - distq and run tests, fail fast, also copies to fdq.js

Note: for the build scripts, dist/fdq.js is a generic output file for both dev and dist builds (since they also create descriptive output files, fdq.js just makes it easy to reference from tests or web no matter which build script you ran).

NPM scripts:

  • npm run coverage - runs mocha, istanbul, and isparta to generate code coverage of all the tests
  • npm run lint - runs eslint
  • npm run lintdev - runs eslint with slightly relaxer rules (like allowing console.log)
  • npm run lintfix - runs eslint with the --fix option to automatically fixup certain rules quickly