From 875651ef386a8357da6839d5592ee00a6ce0dd63 Mon Sep 17 00:00:00 2001
From: Cursor Agent Simple OAuth2.0 helper: auth URL, token exchange, refresh, profile. Scaffold apps, libraries, packages, and snippets from curated templates. Public commands, functions, and components with concise usage examples. See the main site for template catalogs and usage steps. Wrapper for Google Sheets: authorize, manage sheets, and CRUD data. Lightweight React SVG icon loader with component and named exports. Split large XML files by tag and convert chunks to JSON with callbacks. Split large XML files and import parsed JSON into MongoDB.@create-mern-app/auth-service
+ Install
+
+
+ npm install @create-mern-app/auth-service
Usage
+
+
+ import AuthService from '@create-mern-app/auth-service';
+
+const authService = new AuthService({
+ clientId: 'your_client_id',
+ clientSecret: 'your_client_secret',
+ redirectUri: 'http://localhost:5500/callback',
+ authBaseUrl: 'http://localhost:3000'
+});
+
+const url = authService.getAuthUrl();
+// Redirect user to `url`
+
+const { accessToken, refreshToken } = await authService.getAccessToken('auth_code');
+const refreshed = await authService.getRefreshToken(refreshToken);
+const profile = await authService.getUserProfile(accessToken);
+
API
+
+
+constructor({ clientId, clientSecret, redirectUri, authBaseUrl })
getAuthUrl()
getAccessToken(authCode)
→ { accessToken, refreshToken? }
getRefreshToken(refreshToken)
→ { accessToken, refreshToken? }
getUserProfile(accessToken)
create-mernjs-app (CLI)
+ Requirements
+
+
+
+ Usage
+
+
+ npx create-mernjs-app <project-directory> [--template app|library|packages|snippets] [--yes]
Arguments
+
+
+
+ <project-directory>
: Name of the folder to create.Options
+
+
+
+ -y, --yes
: Skip confirmation prompt.--template <type>
: Choose template catalog: app
, library
, packages
, or snippets
.Examples
+
+
+ # Create an app (interactive category selection)
+npx create-mernjs-app my-app
+
+# Create a library project
+npx create-mernjs-app my-lib --template library
+
+# Create from packages catalog
+npx create-mernjs-app my-tool --template packages
+
+# Create from snippets catalog, auto-confirm
+npx create-mernjs-app my-sample --template snippets --yes
What it does
+
+
+
+ package.json
name (and app.json
for React Native).npm install --legacy-peer-deps
.cd <project>
and npm run dev
.Troubleshooting
+
+
+
+ project-directory
.Links
+
+
+Create MERN App - API Documentation
+ CLI
+
+
+ Packages
+
+
+
+ Templates and Boilerplates
+
+
+@mernjs/googlesheets
+ Install
+
+
+ npm install @mernjs/googlesheets
Quick start
+
+
+ import GoogleSheets from '@mernjs/googlesheets';
+
+const sheets = new GoogleSheets();
+await sheets.authorize('path/to/key.json', 'spreadsheet-id');
+await sheets.connectSheet('MyActiveSheet');
+
+await sheets.createSheet('NewSheetTitle');
+const all = await sheets.getAllSheets();
+const values = await sheets.getSheet('sheetId');
+await sheets.updateSheet('sheetId', 'UpdatedTitle');
+await sheets.deleteSheet('sheetId');
+
+await sheets.addHeader(['Name', 'Email']);
+await sheets.insertData([{ Name: 'Alice', Email: 'a@example.com' }]);
+const found = await sheets.findData({ Email: 'a@example.com' });
+await sheets.updateData({ Email: 'a@example.com' }, { Name: 'Alice A.'});
+await sheets.deleteData({ Email: 'a@example.com' });
+
Key methods
+
+
+authorize(keyFile, spreadsheetId)
connectSheet(sheetName)
createSheet(title)
, getAllSheets()
, getSheet(sheetId)
, updateSheet(sheetId, newTitle)
, deleteSheet(sheetId)
addHeader(headers)
, insertData(rows)
, findData(query)
, updateData(filter, update)
, deleteData(filter)
react-svg-icons-loader
+ Install
+
+
+ npm install react-svg-icons-loader
Usage
+ Icon component
+
+
+ import Icon from 'react-svg-icons-loader';
+
+export default function Example() {
+ return (
+ <div>
+ <Icon name="Hierarchical" size={100} color="blue" />
+ <Icon name="Businessman" size={100} color="blue" />
+ </div>
+ );
+}
Named icons
+
+
+ import { Businessman, Hierarchical } from 'react-svg-icons-loader';
+
+export default function Example() {
+ return (
+ <div>
+ <Hierarchical size={100} color="blue" />
+ <Businessman size={100} color="blue" />
+ </div>
+ );
+}
Props
+
+
+name
(Icon only): string icon namesize
: number pixelscolor
: string CSS colorxml-to-json-chunk-processor
+ Install
+
+
+ npm install xml-to-json-chunk-processor
Usage
+
+
+ const xmltoJson = require('xml-to-json-chunk-processor');
+
+const params = {
+ xmlUrl: 'path/to/large.xml',
+ openingTag: '<item>',
+ closingTag: '</item>',
+ chunkSize: 2500,
+ callback: (data) => {
+ console.log('Processed data:', data);
+ }
+};
+
+xmltoJson(params)
+ .then(() => console.log('XML Processing Completed'))
+ .catch(console.error);
+
Parameters
+
+
+xmlUrl
: string path to XML fileopeningTag
: string like <item>
closingTag
: string like </item>
chunkSize
: number, default 2500callback
: function receiving parsed JSON per chunkxml-to-mongodb-importer
+ Install
+
+
+ npm install xml-to-mongodb-importer
Usage
+
+
+ const { runImporter } = require('xml-to-mongodb-importer');
+
+const params = {
+ xmlUrl: 'path/to/file.xml',
+ openingTag: '<item>',
+ closingTag: '</item>',
+ connection: {
+ mongoURI: 'mongodb://localhost:27017',
+ databaseName: 'yourDb',
+ collectionName: 'items'
+ },
+ chunkSize: 2500
+};
+
+runImporter(params)
+ .then(() => console.log('Import completed successfully!'))
+ .catch(console.error);
+
Parameters
+
+
+xmlUrl
: string, path to .xml
fileopeningTag
, closingTag
: strings like <item>
, </item>
connection.mongoURI
: Mongo connection URIconnection.databaseName
: Database nameconnection.collectionName
: Collection namechunkSize
: number, default 2500Getting started is easy!
MERN App.
+ Looking for API and package documentation? Visit the + API Docs for CLI commands and package usage examples. +
+