Skip to content
+91-7795206615
|
info@habilelabs.io

  • Home
  • About
  • Services
    • Custom Application Development
    • UI/UX Designing
    • Web Application Development
    • Offshore Product Services
    • Technical Outsourcing
    • ERP Services
  • Company
    • Careers
    • Case Studies
  • Specialization
    • Frontend Frameworks
      • Angular
      • ReactJS
      • VueJS
      • HTML / CSS
      • Javascript /Jquery
      • Bootstrap
      • Material design
    • Backend Frameworks
      • NodeJS
      • Meteor
      • GraphQL
      • Loopback
      • Salesforce
      • Spring Boot
      • Odoo
      • Laravel
    • Database / ORM
      • MySQL
      • PostgreSQL
      • Oracle
      • MongoDB
      • Google Firebase
      • Mongoose
      • Sequelize
      • Hibernate / JPA
    • Languages
      • Java Script
      • Dot Net
      • Java
      • Python
      • C / C++
      • PHP
      • AI / ML
      • Type Script
    • Mobile Frameworks
      • Ionic
      • Native Script
      • Native Android App
      • Native iOS App
      • Google Flutter
      • React Native
  • Blog
  • Hire Us

Getting started with meteor packages (Install, Use and Build)

Categories

  • Angular
  • Business Strategies
  • Cloud Services
  • CRM
  • Design Pattern
  • E-commerce
  • ERP Applications
  • Javascript
  • Meteor
  • Mobile development
  • Mongo DB
  • Node JS
  • Odoo
  • Our Partners
  • PHP
  • React
  • SAAS
  • Salesforce
  • SAP
  • Selenium
  • Tech stack Migration
  • Testing
  • UI-UX Design
  • Uncategorized
  • VAPT
  • Visualforce
  • Web Development
  • Web Security

Categories

  • Angular
  • Business Strategies
  • Cloud Services
  • CRM
  • Design Pattern
  • E-commerce
  • ERP Applications
  • Javascript
  • Meteor
  • Mobile development
  • Mongo DB
  • Node JS
  • Odoo
  • Our Partners
  • PHP
  • React
  • SAAS
  • Salesforce
  • SAP
  • Selenium
  • Tech stack Migration
  • Testing
  • UI-UX Design
  • Uncategorized
  • VAPT
  • Visualforce
  • Web Development
  • Web Security

Getting started with meteor packages (Install, Use and Build):

What are meteor packages?

Let’s say you’re making your on a functionality and you realize that some of your functionality could be used in almost any app. In this case, we need to make you independent of your application and make it shareable.

In this case, you need to create a meteor package. This can be installed in any application and it will be working without no extra effort.

This tutorial will get you started on your first meteor package.

Create your first Meteor package:

Getting started with meteor packages, create meteor package and publish. first meteor package. how to create meteor package. tutorial meteor package

atmospherejs is a central repository of meteor package, We create, download and publish packages from here. before getting started please create your account on
atmospherejs.

Let’s start by creating a new meteor project.

1
2
3
meteor create pack
cd pack
 

Now we will create an internal package to this application. A Meteor project can have external and internal packages. External packages are directly user from meteor package manager atmospherejs.
Meteor expects ‘packages’ folder for internal packages.

Create a packages folder in the project folder.

1
2
3
mkdir packages
cd packages
 

In here we store all our custom made packages. Before we create one, we have to remember that the name of our package needs to be in a particular format: “username:packagename”, where username is your Meteor Developer username. If you still have created account on atmospherejs then please create an account. My user name is ‘morwal89’. So after this in this tutorial, I will be using this name. you can use your user name.

Now we will create one sample package.

1
meteor create --package morwal89:simple

This will create a folder ‘simple’ and will create some files inside this folder. It creates packages.js, simple.js, simple-test.js.
We will try to create a simple template.

Add simple-template.html

One Simple TEMPLATE

1
 

Create entry of this newly created file inside package.js. As this file is will load on the client we will use client tag.

1
2
3
4
5
6
7
  Package.onUse(function(api) {
  api.versionsFrom('1.4.0.1');
  api.use('ecmascript');
  api.mainModule('simple.js');
  api.use("templating", "client");
  api.addFiles("simple-template.html", "client");
});

Now we will need to add this new package to our application. Even this is internal package still we need to create dependency. without this, you can get errors like “lookup.js:189 Uncaught Error: No such template: simpleTemplate”
Run command following command in application root folder to add this.

1
meteor add morwal89:simple

We are ready. Now will reference this template in our application.

Edit the main.html inside client folder.

1
  pack

Welcome to Meteor!

{{> simpleTemplate}}

Run Meteor project.

You will on screen One Simple TEMPLATE on screen.

Publish your meteor packages:

Now we will publish this package on atmosphere.

You will need to login to meteor shell using the command line. Go to simple package root folder and log in on Meteor.
To login run

1
meteor login

This will ask you username and passwords. After login completed you are ready to publish your first package.
run following command

1
meteor publish --create

Congrats your first package is published. Login to atmospherejs to see your first published package.

Still having a problem in this process? Let me know in comments sections. I uploaded the full source code for a tutorial on GitHub. Download this from Here . We are best wed development service provider

Hope you enjoy this post, so don’t forget to share with friends.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]

Posted bymorwal89August 14, 2016November 4, 2019Posted inMeteorTags: Getting started with meteor packages, meteor packages, meteor.js

Post navigation


:

Leave a comment

Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • PyScript – Python for the Web Browser

    PyScript – Python for the Web Browser

  • Cross-Database with Association in Postgres with Sequelize

    Cross-Database with Association in Postgres with Sequelize

  • How can You Improve Your Communication Skills – Effective Tips

    How can You Improve Your Communication Skills – Effective Tips

  • 5 Reasons that Make CRM Software Beneficial for Every Business

    5 Reasons that Make CRM Software Beneficial for Every Business

  • Do Low-Code Solutions have a Future in Web Development?

    Do Low-Code Solutions have a Future in Web Development?

  • A Revenue Management Reset in Consumer Goods

    A Revenue Management Reset in Consumer Goods

Talk to our experts now

Have a project or looking for development team? Contact us.

Get a quote

About Us

Habilelabs Private Limited is the ISO 9001:2015 certified IT company, which has marked its flagship in 20+ countries with 100+ projects successfully

Company

  • About
  • Blog
  • Careers
  • Hire Us
  • Privacy Policy

Contact Us

  • +91-9828247415
  • +91-9887992695
  • info@habilelabs.io

Follow Us

Office

  • Habilelabs Private Limited
    4th Floor, I.G.M. School Campus,
    Sec-93 Agarwal Farm, Mansarovar,
    Jaipur, Rajasthan India
    Pin:302020