Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/onokumus/mneme

Hybrid NPM Module for ESM and CommonJS
https://github.com/onokumus/mneme

Last synced: 12 days ago
JSON representation

Hybrid NPM Module for ESM and CommonJS

Awesome Lists containing this project

README

        

# mneme

> Hybrid NPM Module for ESM and CommonJS

## Install

```sh
npm i mneme
```

## Usage

### NodeJS
1. ES Module

```json
// package.json
{
"type": "module"
}
```
```js
// app.js
import { mneme } from "mneme";

console.log(mneme); //=> Hello from mneme!
```

2. CommonJS
```js
const { mneme } = require("mneme");

console.log(mneme); //=> Hello from mneme!
```

### Browser

```html

import { mneme } from "https://cdn.jsdelivr.net/npm/mneme/dist/esm/index.js";
console.log(mneme); //=> Hello from mneme!

console.log(mneme); //=> Hello from mneme!

```