{"id":23053301,"url":"https://github.com/a-ng-d/figmug-utils","last_synced_at":"2026-01-16T13:04:42.590Z","repository":{"id":266752265,"uuid":"899186105","full_name":"a-ng-d/figmug-utils","owner":"a-ng-d","description":"A collection of lightweight, platform-agnostic utility modules designed to accelerate plugin development. These modules provide common functionalities that can be used across any JavaScript/TypeScript project, making them perfect for plugins, extensions, or any web application.","archived":false,"fork":false,"pushed_at":"2025-10-29T11:06:40.000Z","size":1428,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T22:03:18.520Z","etag":null,"topics":["figma-plugin","framer-plugin","modules","penpot-plugin"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-ng-d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-05T19:25:40.000Z","updated_at":"2025-10-29T11:06:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"774709a7-28a7-4544-8db2-4082e8db5401","html_url":"https://github.com/a-ng-d/figmug-utils","commit_stats":null,"previous_names":["a-ng-d/figmug-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/a-ng-d/figmug-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-ng-d%2Ffigmug-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-ng-d%2Ffigmug-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-ng-d%2Ffigmug-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-ng-d%2Ffigmug-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-ng-d","download_url":"https://codeload.github.com/a-ng-d/figmug-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-ng-d%2Ffigmug-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["figma-plugin","framer-plugin","modules","penpot-plugin"],"created_at":"2024-12-16T00:17:25.792Z","updated_at":"2026-01-16T13:04:42.585Z","avatar_url":"https://github.com/a-ng-d.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub package.json version](https://img.shields.io/github/package-json/v/a-ng-d/figmug-utils?color=informational) ![GitHub last commit](https://img.shields.io/github/last-commit/a-ng-d/figmug-utils?color=informational) ![GitHub](https://img.shields.io/github/license/a-ng-d/figmug-utils?color=informational)\n\n# Figmug Utils\n\nA collection of lightweight, platform-agnostic utility modules designed to accelerate plugin development. These modules provide common functionalities that can be used across any JavaScript/TypeScript project, making them perfect for plugins, extensions, or any web application.\n\n## Installation\n\n```bash\nnpm install figmug-utils\n# or\nyarn add figmug-utils\n```\n\n## Available Modules\n\n### Case Transformer\n\nConvert strings between different case formats:\n\n```typescript\nimport { Case } from 'figmug-utils'\n\nconst text = new Case('Hello World Example')\ntext.doSnakeCase() // 'hello_world_example'\ntext.doCamelCase() // 'helloWorldExample'\ntext.doPascalCase() // 'HelloWorldExample'\ntext.doKebabCase() // 'hello-world-example'\n```\n\n### Feature Status\n\nManage feature flags, access control, and cross-platform availability:\n\n```typescript\nimport { FeatureStatus } from 'figmug-utils'\n\n// Define your features with editor and service availability\nconst features = [\n  {\n    name: 'PREMIUM_EXPORT',\n    description: 'Export to premium formats',\n    isActive: true,\n    isPro: true,\n    isNew: false,\n    limit: 10,\n    type: 'ACTION',\n    availabilityForEditors: ['figma', 'dev', 'figjam'],\n    availabilityForServices: ['BROWSE', 'PARTICIPATE'],\n    proForServices: ['PARTICIPATE']\n  }\n]\n\nconst feature = new FeatureStatus({\n  features: features,\n  featureName: 'PREMIUM_EXPORT',\n  planStatus: 'UNPAID',\n  currentService: 'PARTICIPATE',\n  currentEditor: 'figma',\n  suggestion: 'Upgrade to access premium export features'\n})\n\n// Check feature availability and restrictions\nconsole.log(feature.isActive())    // true (feature is active and available for figma)\nconsole.log(feature.isPro())       // true\nconsole.log(feature.isBlocked())   // true (unpaid plan for pro feature)\nconsole.log(feature.isReached(5))  // false (under limit)\nconsole.log(feature.isReached(10)) // true (at limit for unpaid)\n\n// Get suggestion when blocked\nif (feature.isBlocked()) {\n  console.log(feature.isAvailableAndBlocked()) // 'Upgrade to access premium export features'\n}\n```\n\n**Key Features:**\n- ✅ Cross-platform editor support (Figma, Dev Mode, FigJam, Slides, Penpot, etc.)\n- 🎯 Service-specific availability control\n- 💰 Pro/freemium plan management\n- 📊 Usage limits and quota tracking\n- 🚀 New feature flagging\n\n### Class Names Utility\n\nClean conditional class name concatenation:\n\n```typescript\nimport { doClassnames } from 'figmug-utils'\n\nconst classes = doClassnames([\n  'button',\n  isActive \u0026\u0026 'active',\n  isPrimary \u0026\u0026 'primary',\n  undefined,\n  null,\n]) // Returns: 'button active primary'\n```\n\n### Map Utilities\n\nTransform and manipulate data structures:\n\n```typescript\nimport { doMap } from 'figmug-utils'\n\n// Transform arrays with conditional logic\nconst items = doMap([1, 2, 3, 4], (item) =\u003e \n  item % 2 === 0 ? item * 2 : null\n) // Returns: [4, 8] (filtered out odd numbers)\n```\n\n### Scale Utilities\n\nHandle scaling operations for design tools:\n\n```typescript\nimport { doScale } from 'figmug-utils'\n\n// Scale values with different algorithms\nconst scaled = doScale(100, 1.5, 'linear') // Returns: 150\n```\n\n## TypeScript Support\n\nAll modules come with comprehensive TypeScript definitions:\n\n```typescript\n// Feature types\ninterface Feature\u003cT\u003e {\n  name: string\n  description: string\n  isActive: boolean\n  isPro: boolean\n  isNew: boolean\n  limit?: number\n  availabilityForEditors: Array\u003cEditor\u003e\n  availabilityForServices: Array\u003cT\u003e\n  proForServices: Array\u003cT\u003e\n  type: 'SERVICE' | 'DIVISION' | 'ACTION' | 'CONTEXT'\n}\n\ntype PlanStatus = 'UNPAID' | 'PAID' | 'NOT_SUPPORTED'\n\ntype Editor = 'figma' | 'dev' | 'dev_vscode' | 'figjam' | 'slides' | 'penpot' | 'sketch' | 'framer' | 'webflow'\n```\n\n## Why Figmug Utils?\n\n- 🎯 **Platform Agnostic**: Works across all major design tools and development environments\n- 🪶 **Lightweight**: Each module can be imported independently\n- 📦 **Zero Dependencies**: Pure JavaScript implementations\n- 🔒 **Type-Safe**: Written in TypeScript with full type definitions\n- 🧪 **Well Tested**: Comprehensive test coverage with 100% statement coverage\n- 🌐 **Cross-Platform**: Support for Figma, Dev Mode, FigJam, Slides, Penpot, Sketch, and more\n- 🚀 **Feature Management**: Built-in support for feature flags, pro plans, and usage limits\n\n## Advanced Usage Examples\n\n### Cross-Platform Feature Management\n\n```typescript\nimport { FeatureStatus } from 'figmug-utils'\n\n// Define features for a multi-platform plugin\nconst pluginFeatures = [\n  {\n    name: 'AI_GENERATION',\n    description: 'AI-powered content generation',\n    isActive: true,\n    isPro: true,\n    isNew: true,\n    limit: 5,\n    type: 'SERVICE',\n    availabilityForEditors: ['figma', 'figjam', 'penpot'],\n    availabilityForServices: ['DESIGN', 'PROTOTYPE'],\n    proForServices: ['DESIGN']\n  }\n]\n\n// Check availability across different contexts\nconst checkFeature = (editor, service, plan) =\u003e {\n  const feature = new FeatureStatus({\n    features: pluginFeatures,\n    featureName: 'AI_GENERATION',\n    planStatus: plan,\n    currentService: service,\n    currentEditor: editor\n  })\n  \n  return {\n    available: feature.isActive(),\n    blocked: feature.isBlocked(),\n    isNew: feature.isNew(),\n    limitReached: feature.isReached(3)\n  }\n}\n\n// Usage examples\nconsole.log(checkFeature('figma', 'DESIGN', 'UNPAID'))\n// { available: true, blocked: true, isNew: true, limitReached: false }\n\nconsole.log(checkFeature('sketch', 'DESIGN', 'PAID'))\n// { available: false, blocked: false, isNew: true, limitReached: false }\n```\n\n### Combining Multiple Utilities\n\n```typescript\nimport { Case, doClassnames, FeatureStatus } from 'figmug-utils'\n\n// Transform feature names and create CSS classes\nconst createFeatureClasses = (featureName, status) =\u003e {\n  const caseTransformer = new Case(featureName)\n  const baseClass = caseTransformer.doKebabCase()\n  \n  return doClassnames([\n    `feature-${baseClass}`,\n    status.isActive() \u0026\u0026 'active',\n    status.isPro() \u0026\u0026 'pro',\n    status.isNew() \u0026\u0026 'new',\n    status.isBlocked() \u0026\u0026 'blocked'\n  ])\n}\n```\n\n## Test Coverage\n\nFile                | % Stmts | % Branch | % Funcs | % Lines\n--------------------|---------|----------|---------|--------\nAll files           |     100 |    98.61 |     100 |     100\n case               |     100 |      100 |     100 |     100\n  case.ts           |     100 |      100 |     100 |     100\n do-classnames      |     100 |      100 |     100 |     100\n  do-classnames.ts  |     100 |      100 |     100 |     100\n do-map             |     100 |      100 |     100 |     100\n  do-map.ts         |     100 |      100 |     100 |     100\n do-scale           |     100 |    95.45 |     100 |     100\n  do-scale.ts       |     100 |    95.45 |     100 |     100\n feature-status     |     100 |      100 |     100 |     100\n  feature-status.ts |     100 |      100 |     100 |     100\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Build the library\nnpm run build\n```\n\n## Contributing\n\nWe welcome contributions! Please see our contributing guidelines for details.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-ng-d%2Ffigmug-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-ng-d%2Ffigmug-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-ng-d%2Ffigmug-utils/lists"}