Skip to content

Commit edcd260

Browse files
Patch: Compilation from TS to JS with support for ESM and CJS
1 parent cb8ff05 commit edcd260

File tree

4 files changed

+2055
-37
lines changed

4 files changed

+2055
-37
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ npm install @paystack/paystack-sdk --save
1414
## Usage
1515
Import and initialize the library:
1616
```javascript
17-
const Paystack = require('@paystack/paystack-sdk')
17+
const { Paystack } = require('@paystack/paystack-sdk')
1818
const paystack = new Paystack("sk_test_xxxxxx")
1919

2020
paystack.transaction.initialize({email: "test@example.com", amount: 20000})
@@ -24,7 +24,7 @@ paystack.transaction.initialize({email: "test@example.com", amount: 20000})
2424

2525
Import and initialize the library using ES module with `async/await`:
2626
```javascript
27-
import Paystack from '@paystack/paystack-sdk'
27+
import { Paystack } from '@paystack/paystack-sdk'
2828
const paystack = new Paystack("sk_test_xxxxxx")
2929

3030
const initialize = async(email, amount) => {
@@ -43,7 +43,7 @@ initialize(email, amount)
4343

4444
### Typescript
4545
```typescript
46-
import Paystack from '@paystack/paystack-sdk';
46+
import { Paystack } from '@paystack/paystack-sdk';
4747
const paystack = new Paystack("sk_test_xxxxxx");
4848

4949
const initialize = async(email, amount) => {

0 commit comments

Comments
 (0)