open-index/open-npm huggingface dataset:
npm package: @polingo/vue
Description: Vue bindings for the Polingo translation engine
Author: Reinier Hernández Avila
Latest version: 0.0.4

# @polingo/vue

[![npm version](https://img.shields.io/npm/v/%40polingo%2Fvue.svg)](https://www.npmjs.com/package/@polingo/vue)

Vue bindings for the Polingo translation engine.
npm package: @polinom.io/generator-serverless-policy
Description: Generator for the basic IAM policy to allow a user to deploy a Serverless service. Forked from https://github.com/dancrumb/generator-serverless-policy
Author: Dan Rumney
Latest version: 3.1.3

# Serverless Policy Generator

This is a yeoman generator for creating the AWS Policy document that
allows a user to deploy a Serverless service.

Simply run it and provide it with the name of the service and, optionally,
the name of the stage and region for deployment (in case you want to limit the user
in question).

A `${project}-${stage}-${region}-policy.json` file will be created (using `_star_` instead of `*`
in the filename). If an Account ID is provided, the file will be named as `${account}-${project}-${stage}-${region}-policy.json`.
The contents of this can then be used to create a policy in your IAM dashboard.

## Usage

This project requires [Yeoman](https://yeoman.io). Install globally with:

```
npm install -g yo
```

_NB as of 2020-03-05 this requires node >= v10_

Then install the generator:

```
npm install -y generator-serverless-policy
```

Now run in the directory in which you wish to output the policy JSON file:

```
yo serverless-policy
```

The generator will ask questions about region, stage, DynamoDB and S3 before outputting a policy. If this is the first time you have used Yeoman then Yeoman will prompt you about sharing analytics with them; _the answer to this does not affect the generation of the policy_.

## Acknowledgements

The basic Policy Document is taken from https://github.com/serverless/serverless/issues/1439#issuecomment-268434517
npm package: @polioan/global-js
Description: get, set global values in any js env
Author: Ivan Polushin
Latest version: 2.0.1

# global-js
[![version](https://img.shields.io/npm/v/@polioan/global-js.svg)](https://www.npmjs.com/package/@polioan/global-js)
[![license](https://img.shields.io/github/license/polioan/global-js)](https://opensource.org/licenses/MIT)

get, set global values in any js env

## Use case

### Test

```ts
import { setGlobal, getEnv } from '@polioan/global-js'

function toTest() {
  return 333
}

if (getEnv('NODE_ENV') === 'test') {
  setGlobal('toTest', toTest)
}
```

### Global cache (useful for hot reload)

```ts
import { getEnv, getGlobal, setGlobal } from '@polioan/global-js'
import { PrismaClient } from '@prisma/client'

export const prisma: PrismaClient = getGlobal('prisma') ?? new PrismaClient({})

if (getEnv('NODE_ENV') !== 'production') {
  setGlobal('prisma', prisma)
}
```

### Libs for browser

```ts
import { setGlobal } from '@polioan/global-js'

class Myjquery {}

setGlobal('$', new Myjquery())
```

### Polyfills

```ts
import { setGlobal } from '@polioan/global-js'

if (typeof structuredClone === 'undefined') {
  setGlobal('structuredClone', value => JSON.parse(JSON.stringify(value)))
}
```

### Creating global libraries

```ts
import { setGlobal } from '@polioan/global-js'

declare global {
  var calculate: (a: number, b: number) => number
}

setGlobal('calculate', (a: number, b: number) => a + b)

const test = calculate(2, 3) // will work
```

## Install

### npm

```shell
npm i @polioan/global-js
```

### yarn

```shell
yarn add @polioan/global-js
```

### CDN

```html
<script src="https://unpkg.com/@polioan/global-js@2.0.1/dist/index.global.js"></script>
<script>
  setGlobal('some', 'test')
</script>
```

### Deno

```ts
import { setGlobal } from 'https://deno.land/x/global_js@2.0.1/src/index.ts'
setGlobal('some', 'test')
```
npm package: @polioan/zod-env
Description: Parsing .env using Zod
Author: Ivan Polushin
Latest version: 1.0.0

# zod-env

[![version](https://img.shields.io/npm/v/@polioan/zod-env.svg)](https://www.npmjs.com/package/@polioan/zod-env)
[![license](https://img.shields.io/github/license/polioan/zod-env)](https://opensource.org/licenses/MIT)

## Install

### npm

```shell
npm i @polioan/zod-env
```

### yarn

```shell
yarn add @polioan/zod-env
```

## Usage

### Normal

```ts
import { defineEnvSchema } from '@polioan/zod-env'
import { z } from 'zod'

const env = defineEnvSchema({
  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),
})

const value = env('NODE_ENV') // "production" | "development"
const unknownValue = env('FOO') // string | undefined
```

### In bundler environment

```ts
import { defineEnvSchema } from '@polioan/zod-env'
import { z } from 'zod'

const env = defineEnvSchema({
  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),
  values: {
    NODE_ENV: process.env.NODE_ENV,
  },
})

const value = env('NODE_ENV') // "production" | "development"
const unknownValue = env('FOO') // string | undefined
```

### With Deno or other "non process.env"

```ts
const env = defineEnvSchema({
  schema: z.object({ NODE_ENV: z.enum(['production', 'development']) }),
  envResolver: {
    getFallback() {
      return Deno.env.toObject()
    },
    get(key) {
      return Deno.env.get(key)
    },
  },
})
```
npm package: @polite/cli
Description: ---- A polite and semantic command line utility powered by middleware.   Written for and tested on node v8.9.1+ with support for Babel.
Latest version: 0.0.1

## @polite/cli
----
A polite and semantic command line utility powered by middleware.  
Written for and tested on node v8.9.1+ with support for Babel.

----

## How does it work?
Polite uses the `please` command to provide a flexible and easy-to-use command line platform for your application.
Polite scans the working directory for one of the following files:
+ polite.js
+ polite.config.js
+ polite.babel.js
+ polite.{**process.env.NODE_ENV**}.js

You can define procedures and middleware in your configuration file, and polite provides useful help text and common libraries to aid you.

----

## Command Line Options
* `--babel`
    * Enables babel-register & babel-polyfill

## Configuration Options
* procedures &nbsp; <sup>`object`</sup>
    * A hashmap keyed by procedure name and containing procedure objects
* middleware &nbsp; <sup>`array`</sup>
    * An array of middleware methods to be executed _before_ any procedures
* postMiddleware &nbsp; <sup>`array`</sup>
    * An array of middleware methods to be executed _after_ any procedures
* babel &nbsp; <sup>`bool`</sup>
    * Enables babel-register & babel-polyfill

----

## Procedure Object Specification
A procedure object should contain the following keys:
* name &nbsp; <sup>`string`</sup>
    - a string name to be used for help text
* description &nbsp; <sup>`string`</sup>
    - descriptive text for use in the "help" command
* run &nbsp; <sup>`fn(ctx, next)`</sup>
    - a middleware method to be executed for this procedure
 
----

## Example Configuration
```javascript
module.exports = {
  procedures: {
    test: {
      name: "test",
      description: "Descriptive text for use in the 'help' command",
      run: async (ctx, next) => {
        console.log("Test:", ctx.hasTestMiddleware); // Test: true
        await next();
      }
    },
    test2: {
      name: "test2",
      description:
        "This method does not await next, so 'All done!' will not be logged",
      run: async (ctx, next) => {
        console.log("Test2:", ctx.hasTestMiddleware); // Test2: true
        ctx.inputLoop = true; // Begins an infinite input loop until the user requests an "exit"
        // Since this method does not 'await next()' the postMiddleware will not execute
      }
    }
  },
  middleware: [
    // These methods will be added to the stack _before_ procedure execution
    async (ctx, next) => {
      ctx.hasTestMiddleware = true;
      await next();
    }
  ],
  postMiddleware: [
    // These methods will be added to the stack _after_ procedure execution
    async (ctx, next) => {
      console.log("All done!");
    }
  ]
};

```

## Example Usage
```bash
> please test
Test: true
All done!
> please test2
Test2: true
All done!
```
npm package: @politeshop/lib
Description: Reverse-engineered POLITEMall client
Latest version: 1.0.1

# POLITELib

JS/TS library for interacting with reverse-engineered [POLITEMall](https://politemall.polite.edu.sg/) APIs (`*.polite.edu.sg` and `*.api.brightspace.com`). Made for the [POLITEShop browser extension](https://github.com/haziq21/politeshop).

```typescript
import { POLITELib } from "@politeshop/lib";

const ps = new POLITELib({
  d2lSessionVal: "sNtnzd...",
  d2lSecureSessionVal: "eqoLoG...",
  domain: "nplms",
});

// { id: '490586', name: 'HAZIQ DANISH BIN HAIRIL RIZAL' }
const user = await ps.getUser();

// [{ id: '803172', name: 'DATA STRUCTURES & ALGORITHMS (2_DSA_011791)', code: '25S2-2_DSA_011791' }, ...]
const modules = await ps.getModules();

const content = await ps.getModuleContent(modules[0].id);
```

## Terminology

There are some differences in terminology between Singapore's Polytechnics / ITE and the underlying APIs. This library follows Polytechnic / ITE terminology.

| POLITELib                 | Underlying APIs              | Definition                                                   |
| ------------------------- | ---------------------------- | ------------------------------------------------------------ |
| Course                    | Course                       | A course of study (e.g. Information Technology). A student can only be in one course. |
| Module                    | Enrollment / Course offering | A timetabled subject studied, e.g. Data Structures & Algorithms. |
| Activity                  | Activity / Topic             | An individual POLITEMall page containing text, media embeds, submission dropboxes, interactive activities, etc. |
| Top-level activity folder | Module                       | A "root" group of POLITEMall content. By definition, these are not nested. |
| Activity folder           | Unit                         | A group of POLITEMall content. These can be nested.          |