open-index/open-npm huggingface dataset:
npm package: @goweekdays/utils
Description: This project utilizes environment variables for configuration. Below is a list of variables you need to set either in a `.env` file or in your environment:
Latest version: 1.1.8

# Project Environment Configuration

This project utilizes environment variables for configuration. Below is a list of variables you need to set either in a `.env` file or in your environment:

- **MONGO_URI**: MongoDB connection URI.
- **MONGO_DB**: MongoDB database name for production.
- **MONGO_DB_DEV**: MongoDB database name for development.
- **PORT**: Port number the server should listen on.
- **SECRET_KEY**: Secret key for cryptographic operations.
- **isDev**: Boolean indicating if the environment is development (`true`) or production (`false`).
- **MAILER_TRANSPORT_HOST**: Hostname for mailer transport (e.g., SMTP server).
- **MAILER_TRANSPORT_PORT**: Port number for mailer transport.
- **MAILER_TRANSPORT_SECURE**: Boolean indicating if the mailer transport should use secure connection (`true` or `false`).
- **MAILER_EMAIL**: Email address for sending emails.
- **MAILER_PASSWORD**: Password for the email account.
- **ACCESS_TOKEN_SECRET**: Secret key for JWT access tokens.
- **REFRESH_TOKEN_SECRET**: Secret key for JWT refresh tokens.
- **ACCESS_TOKEN_EXPIRY**: Expiry time for JWT access tokens.
- **REDIS_HOST**: Hostname for Redis server.
- **REDIS_PORT**: Port number for Redis server.
- **REDIS_PASSWORD**: Password for Redis server (if applicable).

## Setting Up

1. Clone the repository and navigate to the project directory.
2. Create a `.env` file in the root directory.
3. Copy the variables from this document into your `.env` file and set appropriate values.

```
MONGO_URI=mongodb://localhost:27017
MONGO_DB=default
MONGO_DB_DEV=default-dev
PORT=3001
SECRET_KEY=your_secret_key_here
MAILER_TRANSPORT_HOST=smtp.example.com
MAILER_TRANSPORT_PORT=465
MAILER_TRANSPORT_SECURE=true
MAILER_EMAIL=your_email@example.com
MAILER_PASSWORD=your_email_password
ACCESS_TOKEN_SECRET=your_access_token_secret
REFRESH_TOKEN_SECRET=your_refresh_token_secret
ACCESS_TOKEN_EXPIRY=1d
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your_redis_password
```

4. Save the `.env` file.

## Notes

- Ensure all environment variables are correctly set before starting the application.
- For development, consider using tools like `dotenv` to load environment variables from a `.env` file automatically.
npm package: @gowerstreet/infintestimal
Description: A minimal predicate-based testing library for Sibilant
Author: sleepyfox@gmail.com
Latest version: 1.1.1

# Infintestimal

A minimal predicate-based testing library for Sibilant

## Rationale

Most JavaScript testing libraries are written around the idea that when a test fails, it throws. As to why this might be considered a bad idea, have a look at Joel Spolsky's blog post ['on exceptions'](http://www.joelonsoftware.com/2003/10/13/13/).

If you agree with this viewpoint, you might think it would be nice to have a testing library where a test is basically just a function that returns true or false, and a test suite is just a list of tests, and a test runner is a function that just maps over this list transforming test functions into output.

This is what Infintestimal does. It is written in Sibilant, a LISP that is a very shallow transformation to readable JavaScript, but the code is useable from plain old JS, like so [example-test.js](example-test.js):

```javascript
var {is, testRunner} = require('@gowerstreet/infintestimal')

var exampleSuite = [["This is a test that passes",
                     () => is(1, 1) ],
                    ["This is a test that fails",
                     () => is(1, 2) ],
                    ["We can compare arrays",
                     () => {let result = [1, 2]
                            return is([1, 2], result)} ],
                    ["We can also compare objects",
                     function named (){let result = { a: 1, b: 2 }
                                       return is({ b: 2, a: 1 }, result)} ],
                    ["Comparisons that fail show the expected and actual",
                     () => is({ a: 1, b: 2 }, { a: 1, b: 1 }) ],
                    ["We can test async functions",
                     (done) => setTimeout(() => done(is(1,1)), 1000) ]]

testRunner(exampleSuite)
```

The first line imports the `is` and `testRunner` functions from the infintestimal library.

The next line creates a test suite, an array of test tuples. Each test tuple has a name and a thunk (a function with no parameters) that returns the result of calling `is` which is the equivalent of `assert.equal(expected, actual)` for values and `assert.deepEqual(expected, actual)` for arrays and objects.

Finally the call to `testRunner` with the suite of tests (which are just data) runs the tests and prints the results.

As you can see from the last example, testing an async function just requires that you pass a callback function to your test function, and then call it with the results of evaluating `is` on your expected and actuals.

Running this with `node example-test.js` produces the following output:

```
Running tests...

This is a test that passes ✔
This is a test that fails ✘
  expected 1 but got 2
We can compare arrays ✔
We can also compare objects ✔
Comparisons that fail show the expected and actual ✘
  expected {
  "a": 1,
  "b": 2
}
but got {
  "a": 1,
  "b": 1
}
✔ We can test async functions
4 tests passed, 2 failed
```
npm package: @gowerstreet/route66
Description: A minimal HTTP routing library for Sibilant
Author: sleepyfox@gmail.com
Latest version: 1.0.2

# route66

A very minimalistic HTTP routing library for Sibilant (also usable in Node.js).

## Usage

The idea of Route66 is that, in typical LISP fashion, routes are data. Each route is a combination of
a regular expression and a HTTP handler function to dispatch to, which takes (http-request, http-response)
parameters. 

A call to route66.create-dispatcher with the routes and a fallback 'not-found' handler (that is used if no matches are found) returns a dispatch function that when called with (url) returns the first matched handler function (or the not found handler). A simple example is provided below:

The code is just 44 lines, so any questions: just read the source.

```clojure
;; Imports
(var http (require 'http)
     route66 (require "@gowerstreet/route66"))

;; Constants
(var PORT 8000)

(def home (req res)
  (res.write-head 200 {"Content-Type" "text/plain"})
  (res.end "You're home now, sigh."))

(def cats (req res)
  (res.write-head 200 {"Content-Type" "application/json"})
  (res.end (JSON.stringify [["British shorthair" "https://en.wikipedia.org/wiki/British_Shorthair"]
                            ["Somali"            "https://en.wikipedia.org/wiki/Somali_cat"]
                            ["Abyssinian"        "https://en.wikipedia.org/wiki/Abyssinian_cat"]
                            ["Maine Coon"        "https://en.wikipedia.org/wiki/Maine_Coon"]])))

(def not-found (res)
  (res.write-head 404 {"Content-Type" "text/plain"})
  (res.end "404 Not found\n"))

(var routes [["GET /cats" cats]
             ["GET /"     home]]
     dispatcher (route66.create-dispatcher routes not-found))

(def handler (req res)
  (var dispatch-to (dispatcher (+ req.method " " req.url)))
  (console.log "request:" (.toISOString (new Date)) req.method req.url)
  (dispatch-to req res))

(pipe
  (http.create-server handler)
  (.listen PORT "0.0.0.0"))

(console.log "Server listening on port" PORT)
```

## License

MIT - see the [license file](LICENSE).