Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(README): convert common js requires to esm imports #217

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ $ npm install @podium/context
Generate a context which can be passed on to an http request to a Podlet:

```js
const { HttpIncoming } = require('@podium/utils');
const Context = require('@podium/context');
const http = require('http');
import { HttpIncoming } from '@podium/utils';
import Context from '@podium/context';
import http from 'http';

// Set up a context with the name 'myLayout'
const context = new Context({ name: 'myLayout' });
Expand Down Expand Up @@ -98,7 +98,7 @@ server.
Creates a new Podium context instance.

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({ name: 'myName' });
```

Expand Down Expand Up @@ -179,10 +179,10 @@ This method takes the following arguments:
Example:

```js
const { HttpIncoming } = require('@podium/utils');
const Context = require('@podium/context');
const Parser = require('my-custom-parser');
const http = require('http');
import { HttpIncoming } from '@podium/utils';
import Context from '@podium/context';
import Parser from 'my-custom-parser';
import http from 'http';

// Set up a context and register the custom parser
const context = new Context({ name: 'myLayout' });
Expand Down Expand Up @@ -285,7 +285,7 @@ by passing an options object for the specific parser (see constructor options).
Example of passing options to the built in `debug` parser:

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({
name: 'myName',
debug: {
Expand All @@ -311,7 +311,7 @@ The parser takes a string (required) as the first argument to the constructor.
Example:

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({
name: 'myName',
});
Expand Down Expand Up @@ -422,7 +422,7 @@ This parser takes an optional config object with the following properties:
Example:

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({
name: 'myName',
mountOrigin: {
Expand Down Expand Up @@ -450,7 +450,7 @@ This parser takes an optional config object with the following properties:
Example:

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({
name: 'myName',
mountPathname: {
Expand Down Expand Up @@ -487,7 +487,7 @@ This parser takes an optional config object with the following properties:
Example:

```js
const Context = require('@podium/context');
import Context from '@podium/context';
const context = new Context({
name: 'myName',
publicPathname: {
Expand Down